pub struct FunctionExecutor { /* private fields */ }Expand description
Executes functions with timeout and error handling.
Implementations§
Source§impl FunctionExecutor
impl FunctionExecutor
Sourcepub fn new(registry: Arc<FunctionRegistry>, db_pool: PgPool) -> Self
pub fn new(registry: Arc<FunctionRegistry>, db_pool: PgPool) -> Self
Create a new function executor.
Sourcepub fn with_timeout(
registry: Arc<FunctionRegistry>,
db_pool: PgPool,
default_timeout: Duration,
) -> Self
pub fn with_timeout( registry: Arc<FunctionRegistry>, db_pool: PgPool, default_timeout: Duration, ) -> Self
Create a new function executor with custom timeout.
Sourcepub fn with_dispatch(
registry: Arc<FunctionRegistry>,
db_pool: PgPool,
job_dispatcher: Option<Arc<dyn JobDispatch>>,
workflow_dispatcher: Option<Arc<dyn WorkflowDispatch>>,
) -> Self
pub fn with_dispatch( registry: Arc<FunctionRegistry>, db_pool: PgPool, job_dispatcher: Option<Arc<dyn JobDispatch>>, workflow_dispatcher: Option<Arc<dyn WorkflowDispatch>>, ) -> Self
Create a new function executor with dispatch capabilities.
Sourcepub async fn execute(
&self,
function_name: &str,
args: Value,
auth: AuthContext,
request: RequestMetadata,
) -> Result<ExecutionResult>
pub async fn execute( &self, function_name: &str, args: Value, auth: AuthContext, request: RequestMetadata, ) -> Result<ExecutionResult>
Execute a function call.
Sourcepub fn has_function(&self, function_name: &str) -> bool
pub fn has_function(&self, function_name: &str) -> bool
Check if a function exists.
Auto Trait Implementations§
impl !Freeze for FunctionExecutor
impl !RefUnwindSafe for FunctionExecutor
impl Send for FunctionExecutor
impl Sync for FunctionExecutor
impl Unpin for FunctionExecutor
impl !UnwindSafe for FunctionExecutor
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> 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>
Converts
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>
Converts
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