pub struct TaskDialer { /* private fields */ }Expand description
Reusable handle for the control plane’s AgentTaskService.
The durable task-record path a protocol edge drives its lifecycle over.
Shares the AgentService endpoint — both are served on one Connect port —
so it is built from the same address.
Bearer-only, exactly like ApprovalDialer::with_bearer: these calls send
no AgentStart, so no signed attribution envelope rides them.
Implementations§
Source§impl TaskDialer
impl TaskDialer
Sourcepub fn new(addr: &str) -> Result<Self, DialError>
pub fn new(addr: &str) -> Result<Self, DialError>
Build a dialer pointed at addr (expects http://host:port).
§Errors
Returns DialError::InvalidAddress if addr isn’t a valid URI, or
DialError::Tls if an https endpoint’s TLS setup fails.
Sourcepub fn with_bearer(addr: &str, bearer: &str) -> Result<Self, DialError>
pub fn with_bearer(addr: &str, bearer: &str) -> Result<Self, DialError>
Build a dialer pointed at addr, authenticated with bearer.
§Errors
Returns DialError::InvalidAddress if addr isn’t a valid URI,
DialError::Tls if an https endpoint’s TLS setup fails, or
DialError::InvalidBearer if bearer can’t be encoded as an HTTP
header value.
Sourcepub async fn create_task(
&self,
task_id: &str,
context_id: &str,
history: Vec<Vec<u8>>,
) -> Result<AgentTaskRecord, DialError>
pub async fn create_task( &self, task_id: &str, context_id: &str, history: Vec<Vec<u8>>, ) -> Result<AgentTaskRecord, DialError>
Mint a task in AgentTaskState::Submitted and index it under
context_id, carrying history as its opening frames.
§Errors
Returns DialError::Connect for any transport or encoding error,
including the control plane’s refusal of an identity that already
exists (already_exists).
Sourcepub async fn transition_task(
&self,
task_id: &str,
state: AgentTaskState,
successor: AgentTaskTransition,
ownership: &AgentTaskOwnership,
) -> Result<AgentTaskRecord, DialError>
pub async fn transition_task( &self, task_id: &str, state: AgentTaskState, successor: AgentTaskTransition, ownership: &AgentTaskOwnership, ) -> Result<AgentTaskRecord, DialError>
Move a live task to state, carrying successor’s frames.
§Errors
Returns DialError::Connect for any transport or encoding error,
including not_found for an unknown task and failed_precondition
for a task that already finished.
Sourcepub async fn claim_task(
&self,
task_id: &str,
dispatch_id: &str,
worker_instance: &str,
attempt_id: &str,
appended_history: Vec<Vec<u8>>,
) -> Result<(AgentTaskRecord, AgentTaskOwnership), DialError>
pub async fn claim_task( &self, task_id: &str, dispatch_id: &str, worker_instance: &str, attempt_id: &str, appended_history: Vec<Vec<u8>>, ) -> Result<(AgentTaskRecord, AgentTaskOwnership), DialError>
Claims one task for a durable source dispatch before its turn runs.
worker_instance is stable for one edge process and attempt_id for
one delivery attempt. Exact retries reuse both; a competing execution
must use a different attempt.
§Errors
Returns DialError::Connect for transport failures, malformed
ownership replies, or a live competing claim.
Sourcepub async fn renew_task_claim(
&self,
task_id: &str,
ownership: &AgentTaskOwnership,
ordinal: u64,
) -> Result<(), DialError>
pub async fn renew_task_claim( &self, task_id: &str, ownership: &AgentTaskOwnership, ordinal: u64, ) -> Result<(), DialError>
Renews one exact task ownership capability without changing its fence.
§Errors
Returns DialError::Connect for transport failures or a stale
capability. Ambiguous transport outcomes replay the same ordinal.
Sourcepub async fn cancel_task(
&self,
task_id: &str,
) -> Result<AgentTaskRecord, DialError>
pub async fn cancel_task( &self, task_id: &str, ) -> Result<AgentTaskRecord, DialError>
Cancel a live task.
§Errors
Returns DialError::Connect for any transport or encoding error,
including not_found for an unknown task and failed_precondition
for a task that already finished — cancellation’s refusal is part of
its contract, never a quiet success.
Sourcepub async fn get_task(
&self,
task_id: &str,
) -> Result<Option<AgentTaskRecord>, DialError>
pub async fn get_task( &self, task_id: &str, ) -> Result<Option<AgentTaskRecord>, DialError>
Read one task by identity. None means no task exists under it — a
plain absence, not a failure.
§Errors
Returns DialError::Connect for any transport or encoding error.
Sourcepub async fn list_tasks(
&self,
context_id: &str,
page_size: u32,
after: Option<&str>,
) -> Result<AgentTaskPage, DialError>
pub async fn list_tasks( &self, context_id: &str, page_size: u32, after: Option<&str>, ) -> Result<AgentTaskPage, DialError>
Read one bounded page of context_id’s tasks, resuming after after
when a previous page returned one.
§Errors
Returns DialError::Connect for any transport or encoding error,
including invalid_argument for a page size above the server maximum.
Trait Implementations§
Source§impl Clone for TaskDialer
impl Clone for TaskDialer
Source§fn clone(&self) -> TaskDialer
fn clone(&self) -> TaskDialer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TaskDialer
impl !UnwindSafe for TaskDialer
impl Freeze for TaskDialer
impl Send for TaskDialer
impl Sync for TaskDialer
impl Unpin for TaskDialer
impl UnsafeUnpin for TaskDialer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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>
T in a tonic::Request