pub struct OperatorLink { /* private fields */ }Expand description
Operator control routed through core (A2): core sends g4a requests down a node’s control stream and correlates replies. C2 relays the bytes without parsing them.
Wire (inner plaintext): {"op_id": u64, "g4a": <frame>} both ways. Messages without
op_id are node-initiated events and go to the events channel.
Implementations§
Source§impl OperatorLink
impl OperatorLink
Sourcepub fn new(
events: Option<UnboundedSender<G4aMessage>>,
) -> (Self, Receiver<Vec<u8>>)
pub fn new( events: Option<UnboundedSender<G4aMessage>>, ) -> (Self, Receiver<Vec<u8>>)
Returns the link and the outbound queue to hand to DrainConsumer::with_outbound.
pub fn new_with_browser( events: Option<UnboundedSender<G4aMessage>>, browser_events: Option<UnboundedSender<BrowserStreamEvent>>, ) -> (Self, Receiver<Vec<u8>>)
Sourcepub async fn browser_op(
&self,
op: &BrowserClientOp,
timeout: Duration,
) -> Result<BrowserOpReply, OperatorError>
pub async fn browser_op( &self, op: &BrowserClientOp, timeout: Duration, ) -> Result<BrowserOpReply, OperatorError>
Send a browser sidecar op and wait for the node’s BrowserOpReply.
Sourcepub async fn request_pipelined<T: Serialize>(
&self,
frame: &T,
timeout: Duration,
) -> Result<impl Future<Output = Result<G4aMessage, OperatorError>> + Send + 'static, OperatorError>
pub async fn request_pipelined<T: Serialize>( &self, frame: &T, timeout: Duration, ) -> Result<impl Future<Output = Result<G4aMessage, OperatorError>> + Send + 'static, OperatorError>
Enqueue one g4a request toward the node now (preserving send order) and return a future that waits for its reply, so callers can pipeline.
Sourcepub async fn browser_op_pipelined(
&self,
op: &BrowserClientOp,
timeout: Duration,
) -> Result<impl Future<Output = Result<BrowserOpReply, OperatorError>> + Send + 'static, OperatorError>
pub async fn browser_op_pipelined( &self, op: &BrowserClientOp, timeout: Duration, ) -> Result<impl Future<Output = Result<BrowserOpReply, OperatorError>> + Send + 'static, OperatorError>
Enqueue a browser op now (ordered) and return a future for its reply.
Sourcepub async fn request<T: Serialize>(
&self,
frame: &T,
timeout: Duration,
) -> Result<G4aMessage, OperatorError>
pub async fn request<T: Serialize>( &self, frame: &T, timeout: Duration, ) -> Result<G4aMessage, OperatorError>
Send one g4a request (e.g. a RoutedNodeRequest) and wait for its reply.
Sourcepub fn handler(self) -> CoreHandler
pub fn handler(self) -> CoreHandler
Drain handler for the node’s g4a control channel: parses g4a on core only.