pub struct InMemoryTaskStore<Req, Res>{ /* private fields */ }Implementations§
Trait Implementations§
Source§impl<Req, Res> TaskStatusSignal for InMemoryTaskStore<Req, Res>
impl<Req, Res> TaskStatusSignal for InMemoryTaskStore<Req, Res>
Source§fn publish_status_change<'life0, 'life1, 'async_trait>(
&'life0 self,
event: TaskStatusNotificationParams,
session_id: Option<&'life1 String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn publish_status_change<'life0, 'life1, 'async_trait>(
&'life0 self,
event: TaskStatusNotificationParams,
session_id: Option<&'life1 String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Publish a status change event
Source§impl<Req, Res> TaskStore<Req, Res> for InMemoryTaskStore<Req, Res>
impl<Req, Res> TaskStore<Req, Res> for InMemoryTaskStore<Req, Res>
Source§fn create_task<'life0, 'async_trait>(
&'life0 self,
task_params: CreateTaskOptions,
_request_id: RequestId,
request: Req,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = Task> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_task<'life0, 'async_trait>(
&'life0 self,
task_params: CreateTaskOptions,
_request_id: RequestId,
request: Req,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = Task> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a new task with the given creation parameters and original request.
The implementation must generate a unique taskId and createdAt timestamp. Read more
Source§fn start_task_polling(
&self,
get_task_callback: TaskStatusPoller,
) -> SdkResult<()>
fn start_task_polling( &self, get_task_callback: TaskStatusPoller, ) -> SdkResult<()>
Begins active polling for task status updates in requestor mode.
This method spawns a long-running background task that drives the polling
schedule for all tasks managed by this store. It repeatedly invokes the
provided
get_task_callback to query the receiver for the current status
of pending tasks. Read moreSource§fn wait_for_task_result<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = SdkResult<(TaskStatus, Option<Res>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wait_for_task_result<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = SdkResult<(TaskStatus, Option<Res>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Waits asynchronously for the result of a task. Read more
Source§fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = Option<Task>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = Option<Task>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets the current status of a task. Read more
Source§fn store_task_result<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
status: TaskStatus,
result: Res,
session_id: Option<&'life2 String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn store_task_result<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
status: TaskStatus,
result: Res,
session_id: Option<&'life2 String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stores the result of a task and sets its final status. Read more
Source§fn get_task_result<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = Option<Res>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_task_result<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = Option<Res>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves the stored result of a task. Read more
Source§fn update_task_status<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
status: TaskStatus,
status_message: Option<String>,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_task_status<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
status: TaskStatus,
status_message: Option<String>,
session_id: Option<String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Updates a task’s status (e.g., to ‘cancelled’, ‘failed’, ‘completed’). Read more
Auto Trait Implementations§
impl<Req, Res> !Freeze for InMemoryTaskStore<Req, Res>
impl<Req, Res> !RefUnwindSafe for InMemoryTaskStore<Req, Res>
impl<Req, Res> Send for InMemoryTaskStore<Req, Res>
impl<Req, Res> Sync for InMemoryTaskStore<Req, Res>
impl<Req, Res> Unpin for InMemoryTaskStore<Req, Res>
impl<Req, Res> UnsafeUnpin for InMemoryTaskStore<Req, Res>
impl<Req, Res> !UnwindSafe for InMemoryTaskStore<Req, Res>
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