pub struct DurableOrchestrationClient { /* private fields */ }
Expand description
Represents the Durable Functions orchestration client input binding.
The following binding attributes are supported:
Name | Description |
---|---|
name | The name of the parameter being bound. |
task_hub | The name of the task hub to use. Defaults to the value from host.json |
connection | The name of an app setting that contains a storage account connection string. Defaults to the storage account for the function application. |
§Examples
Starting a new orchestration:
use azure_functions::{
bindings::{DurableOrchestrationClient, HttpRequest, HttpResponse},
func,
};
use serde_json::Value;
#[func]
pub async fn start(_req: HttpRequest, client: DurableOrchestrationClient) -> HttpResponse {
match client
.start_new(
"orchestration",
None,
Value::Null,
)
.await
{
Ok(data) => data.into(),
Err(e) => format!("Failed to start orchestration: {}", e).into(),
}
}
Implementations§
Source§impl DurableOrchestrationClient
impl DurableOrchestrationClient
Sourcepub async fn instance_status(
&self,
instance_id: &str,
show_history: bool,
show_history_output: bool,
show_input: bool,
) -> Result<OrchestrationStatus>
pub async fn instance_status( &self, instance_id: &str, show_history: bool, show_history_output: bool, show_input: bool, ) -> Result<OrchestrationStatus>
Gets the status of an orchestration instance.
Sourcepub async fn query_instances<I>(
&self,
created_time_from: Option<DateTime<Utc>>,
created_time_to: Option<DateTime<Utc>>,
runtime_statuses: Option<I>,
top: Option<u32>,
show_history: bool,
show_history_output: bool,
show_input: bool,
) -> Result<Vec<OrchestrationStatus>>where
I: Iterator<Item = OrchestrationRuntimeStatus>,
pub async fn query_instances<I>(
&self,
created_time_from: Option<DateTime<Utc>>,
created_time_to: Option<DateTime<Utc>>,
runtime_statuses: Option<I>,
top: Option<u32>,
show_history: bool,
show_history_output: bool,
show_input: bool,
) -> Result<Vec<OrchestrationStatus>>where
I: Iterator<Item = OrchestrationRuntimeStatus>,
Queries the status for instances in a given date range or with runtime status.
Sourcepub async fn purge_history(&self, instance_id: &str) -> Result<()>
pub async fn purge_history(&self, instance_id: &str) -> Result<()>
Purges the history of the given orchestration instance.
Sourcepub async fn purge_history_by_query<I>(
&self,
created_time_from: Option<DateTime<Utc>>,
created_time_to: Option<DateTime<Utc>>,
runtime_statuses: Option<I>,
) -> Result<u32>where
I: Iterator<Item = OrchestrationRuntimeStatus>,
pub async fn purge_history_by_query<I>(
&self,
created_time_from: Option<DateTime<Utc>>,
created_time_to: Option<DateTime<Utc>>,
runtime_statuses: Option<I>,
) -> Result<u32>where
I: Iterator<Item = OrchestrationRuntimeStatus>,
Purges the history of orchestrations matching the given date range or runtime statuses.
Sourcepub async fn raise_event<D>(
&self,
instance_id: &str,
event_name: &str,
event_data: D,
) -> Result<()>
pub async fn raise_event<D>( &self, instance_id: &str, event_name: &str, event_data: D, ) -> Result<()>
Raises an event for the given orchestration instance.
Sourcepub async fn rewind(&self, instance_id: &str, reason: &str) -> Result<()>
pub async fn rewind(&self, instance_id: &str, reason: &str) -> Result<()>
Restores a failed orchestration instance into a running state by replaying the most recent failed operations.
Auto Trait Implementations§
impl Freeze for DurableOrchestrationClient
impl !RefUnwindSafe for DurableOrchestrationClient
impl Send for DurableOrchestrationClient
impl Sync for DurableOrchestrationClient
impl Unpin for DurableOrchestrationClient
impl !UnwindSafe for DurableOrchestrationClient
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