pub struct GrpcWorkerSession { /* private fields */ }Expand description
gRPC-backed WorkerSession using aion-proto generated tonic stubs.
Implementations§
Source§impl GrpcWorkerSession
impl GrpcWorkerSession
Sourcepub async fn connect(config: WorkerConfig) -> Result<Self, WorkerError>
pub async fn connect(config: WorkerConfig) -> Result<Self, WorkerError>
Connects to the configured worker endpoint.
Opaque credentials are accepted by WorkerConfig but the current AW
worker proto does not define a credential metadata convention, so no
authentication scheme is interpreted here.
§Errors
Returns WorkerError::Connect if tonic cannot create the channel.
Sourcepub fn from_channel(config: WorkerConfig, channel: Channel) -> Self
pub fn from_channel(config: WorkerConfig, channel: Channel) -> Self
Creates a session from an existing tonic channel.
Sourcepub const fn registered_info(&self) -> Option<&RegisteredSessionInfo>
pub const fn registered_info(&self) -> Option<&RegisteredSessionInfo>
Server-assigned registration facts from the RegisterAck, available
once WorkerSession::register has succeeded.
Trait Implementations§
Source§impl WorkerSession for GrpcWorkerSession
impl WorkerSession for GrpcWorkerSession
Source§fn handshake<'life0, 'life1, 'async_trait>(
&'life0 mut self,
config: &'life1 WorkerConfig,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handshake<'life0, 'life1, 'async_trait>(
&'life0 mut self,
config: &'life1 WorkerConfig,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Performs the worker handshake for the configured task queue and identity. Read more
Source§fn register<'life0, 'life1, 'async_trait>(
&'life0 mut self,
activity_types: Vec<String>,
available_handlers: &'life1 BTreeSet<String>,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register<'life0, 'life1, 'async_trait>(
&'life0 mut self,
activity_types: Vec<String>,
available_handlers: &'life1 BTreeSet<String>,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Registers activity-type names implemented by this worker. Read more
Source§fn receive_tasks(&mut self) -> WorkerTaskStream
fn receive_tasks(&mut self) -> WorkerTaskStream
Opens the receive side of AW’s
StreamWorker RPC and yields pushed tasks.Source§fn report_result<'life0, 'async_trait>(
&'life0 mut self,
workflow_id: WorkflowId,
activity_id: ActivityId,
result: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn report_result<'life0, 'async_trait>(
&'life0 mut self,
workflow_id: WorkflowId,
activity_id: ActivityId,
result: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reports successful activity output via
WorkerToServer.result.Source§fn report_failure<'life0, 'async_trait>(
&'life0 mut self,
workflow_id: WorkflowId,
activity_id: ActivityId,
failure: ActivityError,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn report_failure<'life0, 'async_trait>(
&'life0 mut self,
workflow_id: WorkflowId,
activity_id: ActivityId,
failure: ActivityError,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reports explicit activity failure via
WorkerToServer.result.Source§fn send_heartbeat<'life0, 'async_trait>(
&'life0 mut self,
workflow_id: WorkflowId,
activity_id: ActivityId,
progress: Option<Payload>,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_heartbeat<'life0, 'async_trait>(
&'life0 mut self,
workflow_id: WorkflowId,
activity_id: ActivityId,
progress: Option<Payload>,
) -> Pin<Box<dyn Future<Output = Result<(), WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends cooperative progress via
WorkerToServer.heartbeat.Auto Trait Implementations§
impl !Freeze for GrpcWorkerSession
impl !RefUnwindSafe for GrpcWorkerSession
impl !UnwindSafe for GrpcWorkerSession
impl Send for GrpcWorkerSession
impl Sync for GrpcWorkerSession
impl Unpin for GrpcWorkerSession
impl UnsafeUnpin for GrpcWorkerSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request