pub struct Worker { /* private fields */ }Implementations§
Source§impl Worker
impl Worker
pub fn new(client: Client, task_queue: impl Into<String>) -> Self
pub fn worker_id(self, worker_id: impl Into<String>) -> Self
pub fn poll_timeout(self, timeout: Duration) -> Self
pub fn heartbeat_interval(self, interval: Duration) -> Self
pub fn on_worker_heartbeat<F>(self, observer: F) -> Self
pub fn max_concurrent_workflow_tasks(self, count: usize) -> Self
pub fn max_concurrent_activity_tasks(self, count: usize) -> Self
pub fn register_workflow<F, Fut>( &mut self, workflow_type: impl Into<String>, handler: F, )
pub fn register_activity<F, Fut>( &mut self, activity_type: impl Into<String>, handler: F, )
Sourcepub fn register_query<F, Fut>(
&mut self,
workflow_type: impl Into<String>,
query_name: impl Into<String>,
handler: F,
)
pub fn register_query<F, Fut>( &mut self, workflow_type: impl Into<String>, query_name: impl Into<String>, handler: F, )
Register a named, read-only query handler for a workflow type.
The workflow type must also be registered with Worker::register_workflow
before the worker runs. The handler receives only an immutable committed
state snapshot and normalized query arguments.
pub async fn register(&self) -> Result<RegisterWorkerResponse>
pub async fn run(&self) -> Result<()>
pub async fn run_until<F>(&self, shutdown: F) -> Result<()>
pub async fn run_once(&self) -> Result<usize>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Worker
impl !UnwindSafe for Worker
impl Freeze for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
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