pub struct TaskApplication { /* private fields */ }Expand description
The POST /v1/tasks Application — resolves a BlueprintRef and
runs it to completion through TaskLaunchService.
Implementations§
Source§impl TaskApplication
impl TaskApplication
Sourcepub fn new(
launch: Arc<TaskLaunchService>,
store: Arc<dyn BlueprintStore>,
) -> Self
pub fn new( launch: Arc<TaskLaunchService>, store: Arc<dyn BlueprintStore>, ) -> Self
Build a TaskApplication that can resolve both Inline and
Id BlueprintRefs (the Id path reads through store).
Sourcepub fn new_inline_only(launch: Arc<TaskLaunchService>) -> Self
pub fn new_inline_only(launch: Arc<TaskLaunchService>) -> Self
Build a TaskApplication restricted to Inline BlueprintRefs
— no store is configured, so Id resolution always fails with
TaskApplicationError::NoStore.
Sourcepub async fn resolve(
&self,
bp_ref: &BlueprintRef,
) -> Result<(Blueprint, Option<BlueprintVersion>), TaskApplicationError>
pub async fn resolve( &self, bp_ref: &BlueprintRef, ) -> Result<(Blueprint, Option<BlueprintVersion>), TaskApplicationError>
Resolve a BlueprintRef and return the real Blueprint plus,
when it went through the store, the resolved version.
Sourcepub async fn handle_with_run(
&self,
input: TaskApplicationInput,
run_ctx: Option<RunContext>,
) -> Result<TaskApplicationOutput, TaskApplicationError>
pub async fn handle_with_run( &self, input: TaskApplicationInput, run_ctx: Option<RunContext>, ) -> Result<TaskApplicationOutput, TaskApplicationError>
Resolve the BlueprintRef (Inline / Id) and run the flow to
completion through TaskLaunchService::launch, threading run_ctx
(issue #13 run_id propagation) into the launch input.
Application::handle delegates here with run_ctx: None — a
separate method rather than a new field on TaskApplicationInput
so the pre-existing exhaustive TaskApplicationInput { .. } struct
literal in mlua-swarm-cli’s MCP adapter (which has no run_ctx)
keeps compiling unchanged. Server entry points that mint a RunId
up front (POST /v1/tasks, POST /v1/tasks/:id/runs) call this
directly with Some(run_ctx).
Trait Implementations§
Source§impl Application for TaskApplication
impl Application for TaskApplication
Source§fn handle<'life0, 'async_trait>(
&'life0 self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resolve the BlueprintRef (Inline / Id) and run the flow to
completion through TaskLaunchService::launch. Delegates to
TaskApplication::handle_with_run with run_ctx: None (no run
tracing) — callers that need RunRecord.step_entries tracing call
handle_with_run directly instead.
Source§type Input = TaskApplicationInput
type Input = TaskApplicationInput
Source§type Output = TaskApplicationOutput
type Output = TaskApplicationOutput
Source§type Error = TaskApplicationError
type Error = TaskApplicationError
Auto Trait Implementations§
impl !RefUnwindSafe for TaskApplication
impl !UnwindSafe for TaskApplication
impl Freeze for TaskApplication
impl Send for TaskApplication
impl Sync for TaskApplication
impl Unpin for TaskApplication
impl UnsafeUnpin for TaskApplication
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> 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 more