pub struct Submit<'a, Watch = Unwatched, Admission = Waiting> { /* private fields */ }controller only.Expand description
An explicit single-use controller submission operation.
Configure final-outcome delivery and an optional ownership-admission deadline.
Finish with execute or try_intake. The default waiting, unwatched operation can also be awaited directly.
APIs that accept a Future require execute() or IntoFuture::into_future.
Every terminal method consumes the operation, including when intake returns an error.
Watch and Admission are operation type states.
watch and ownership_timeout select them.
Applications do not need to name them.
Implementations§
Source§impl<'a, Admission> Submit<'a, Unwatched, Admission>
impl<'a, Admission> Submit<'a, Unwatched, Admission>
Sourcepub fn watch(self) -> Submit<'a, Watched, Admission>
pub fn watch(self) -> Submit<'a, Watched, Admission>
Final-outcome delivery through TaskWaiter.
Successful intake returns only TaskWaiter.
Its TaskWaiter::id is the submission identity.
The waiter later reports controller rejection or the admitted task’s final outcome.
Source§impl<'a, Watch> Submit<'a, Watch, Waiting>
impl<'a, Watch> Submit<'a, Watch, Waiting>
Sourcepub fn ownership_timeout(
self,
wait_for: Duration,
) -> Submit<'a, Watch, OwnershipTimed>
pub fn ownership_timeout( self, wait_for: Duration, ) -> Submit<'a, Watch, OwnershipTimed>
Cleanup-ownership admission deadline.
The deadline stops after ownership succeeds.
execute can then wait without a deadline for controller command capacity.
An immediately available permit can succeed when wait_for is Duration::ZERO.
A timeout sends no command and publishes no lifecycle event.
Source§impl Submit<'_, Unwatched, Waiting>
impl Submit<'_, Unwatched, Waiting>
Sourcepub async fn execute(self) -> Result<TaskId, ControllerError>
pub async fn execute(self) -> Result<TaskId, ControllerError>
Waiting controller command intake with an unwatched TaskId result.
Ok(id) confirms only command intake.
Slot admission and runtime registration happen later.
Awaiting the default operation directly is equivalent to calling this method.
A successful PreparedSubmission cannot produce NotConfigured.
§Errors
- Returns
ControllerError::NotConfiguredwhen a direct submission has no controller; ControllerError::ThreadStartFailedwhen cleanup workers cannot start;ControllerError::ResourceLimitwhen cleanup ownership is unavailable;ControllerError::Closedwhen controller intake is closed.
Sourcepub fn try_intake(self) -> Result<TaskId, ControllerError>
pub fn try_intake(self) -> Result<TaskId, ControllerError>
Fail-fast controller command intake with an unwatched TaskId result.
Ok(id) has the same intake-only meaning as execute.
A successful PreparedSubmission cannot produce NotConfigured.
§Errors
- Returns
ControllerError::NotConfiguredwhen a direct submission has no controller; ControllerError::ThreadStartFailedwhen cleanup workers cannot start;ControllerError::ResourceLimitwhen cleanup ownership is unavailable;ControllerError::Fullwhen controller command capacity is unavailable;ControllerError::Closedwhen controller intake is closed.
Source§impl Submit<'_, Unwatched, OwnershipTimed>
impl Submit<'_, Unwatched, OwnershipTimed>
Sourcepub async fn execute(self) -> Result<TaskId, ControllerError>
pub async fn execute(self) -> Result<TaskId, ControllerError>
Ownership-bounded admission followed by normal command-queue backpressure.
A successful PreparedSubmission cannot produce NotConfigured.
§Errors
- Returns
ControllerError::NotConfiguredwhen a direct submission has no controller; ControllerError::ThreadStartFailedwhen cleanup workers cannot start;ControllerError::ResourceLimitwhen cleanup ownership cannot be granted;ControllerError::OwnershipAdmissionTimeoutwhen cleanup ownership remains unavailable at the configured deadline;ControllerError::Closedwhen controller intake is closed.
Source§impl Submit<'_, Watched, Waiting>
impl Submit<'_, Watched, Waiting>
Sourcepub async fn execute(self) -> Result<TaskWaiter, ControllerError>
pub async fn execute(self) -> Result<TaskWaiter, ControllerError>
Waiting controller command intake with a final-outcome waiter.
Success confirms only controller command intake.
TaskWaiter::id is the submission identity.
TaskWaiter::wait reports rejection or the admitted task’s final outcome.
A successful PreparedSubmission cannot produce NotConfigured.
§Errors
- Returns
ControllerError::NotConfiguredwhen a direct submission has no controller; ControllerError::ThreadStartFailedwhen cleanup workers cannot start;ControllerError::ResourceLimitwhen cleanup ownership is unavailable;ControllerError::Closedwhen controller intake is closed.
Sourcepub fn try_intake(self) -> Result<TaskWaiter, ControllerError>
pub fn try_intake(self) -> Result<TaskWaiter, ControllerError>
Fail-fast controller command intake with a final-outcome waiter.
A successful PreparedSubmission cannot produce NotConfigured.
§Errors
- Returns
ControllerError::NotConfiguredwhen a direct submission has no controller; ControllerError::ThreadStartFailedwhen cleanup workers cannot start;ControllerError::ResourceLimitwhen cleanup ownership is unavailable;ControllerError::Fullwhen controller command capacity is unavailable;ControllerError::Closedwhen controller intake is closed.
Source§impl Submit<'_, Watched, OwnershipTimed>
impl Submit<'_, Watched, OwnershipTimed>
Sourcepub async fn execute(self) -> Result<TaskWaiter, ControllerError>
pub async fn execute(self) -> Result<TaskWaiter, ControllerError>
Ownership-bounded admission with a final-outcome waiter after command intake.
A successful PreparedSubmission cannot produce NotConfigured.
§Errors
- Returns
ControllerError::NotConfiguredwhen a direct submission has no controller; ControllerError::ThreadStartFailedwhen cleanup workers cannot start;ControllerError::ResourceLimitwhen cleanup ownership cannot be granted;ControllerError::OwnershipAdmissionTimeoutwhen cleanup ownership remains unavailable at the configured deadline;ControllerError::Closedwhen controller intake is closed.