Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 24 additions & 27 deletions src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,17 @@ pub trait ContextClient<'ctx>: private::SealedContext<'ctx> {
/// }
///
/// # async fn handler(ctx: Context<'_>) {
/// let client = ctx.service_client::<MyServiceClient>();
/// let client = ctx.service_client::<MyServiceClient>();
///
/// // Do request
/// let result = client.handle().call().await;
/// // Do request
/// let result = client.handle().call().await;
///
/// // Just send the request, don't wait the response
/// client.handle().send();
///
/// // Schedule the request to be executed later
/// client.handle().send_with_delay(Duration::from_secs(60));
/// }
/// // Just send the request, don't wait the response
/// client.handle().send();
///
/// // Schedule the request to be executed later
/// client.handle().send_with_delay(Duration::from_secs(60));
/// # }
/// ```
fn service_client<C>(&self) -> C
where
Expand All @@ -271,18 +270,17 @@ pub trait ContextClient<'ctx>: private::SealedContext<'ctx> {
/// }
///
/// # async fn handler(ctx: Context<'_>) {
/// let client = ctx.object_client::<MyObjectClient>("my-key");
///
/// // Do request
/// let result = client.handle().call().await;
/// let client = ctx.object_client::<MyObjectClient>("my-key");
///
/// // Just send the request, don't wait the response
/// client.handle().send();
/// // Do request
/// let result = client.handle().call().await;
///
/// // Schedule the request to be executed later
/// client.handle().send_with_delay(Duration::from_secs(60));
/// }
/// // Just send the request, don't wait the response
/// client.handle().send();
///
/// // Schedule the request to be executed later
/// client.handle().send_with_delay(Duration::from_secs(60));
/// # }
/// ```
fn object_client<C>(&self, key: impl Into<String>) -> C
where
Expand All @@ -303,18 +301,17 @@ pub trait ContextClient<'ctx>: private::SealedContext<'ctx> {
/// }
///
/// # async fn handler(ctx: Context<'_>) {
/// let client = ctx.workflow_client::<MyWorkflowClient>("my-key");
///
/// // Do request
/// let result = client.handle().call().await;
/// let client = ctx.workflow_client::<MyWorkflowClient>("my-key");
///
/// // Just send the request, don't wait the response
/// client.handle().send();
/// // Do request
/// let result = client.handle().call().await;
///
/// // Schedule the request to be executed later
/// client.handle().send_with_delay(Duration::from_secs(60));
/// }
/// // Just send the request, don't wait the response
/// client.handle().send();
///
/// // Schedule the request to be executed later
/// client.handle().send_with_delay(Duration::from_secs(60));
/// # }
/// ```
fn workflow_client<C>(&self, key: impl Into<String>) -> C
where
Expand Down