AppModule

PackageAxial
Starts and controls root Flow applications without requiring an external hosting framework.

Summary

NameSignatureSynopsis
startApp.start environment applicationStarts a root workflow and returns a handle that owns its lifetime.
startWithCancellationApp.startWithCancellation cancellationToken environment applicationStarts a root workflow linked to an external cancellation token.
runApp.run environment applicationRuns a root workflow to completion using the caller's asynchronous cancellation token.
runWithCancellationApp.runWithCancellation cancellationToken environment applicationRuns a root workflow to completion using an explicit host-owned cancellation token.

start

App.start environment application
Member
Starts a root workflow and returns a handle that owns its lifetime.

Parameters

NameTypeDescription
environment'envThe explicit environment supplied to the root workflow.
applicationFlow<'env, 'error, 'value>The root workflow to start.

Returns

AppHandle<'error, 'value>

startWithCancellation

App.startWithCancellation cancellationToken environment application
Member
Starts a root workflow linked to an external cancellation token.

Parameters

NameTypeDescription
cancellationTokenCancellationTokenA host-owned token that requests application stop when cancelled.
environment'envThe explicit environment supplied to the root workflow.
applicationFlow<'env, 'error, 'value>The root workflow to start.

Returns

AppHandle<'error, 'value>

run

App.run environment application
Member
Runs a root workflow to completion using the caller's asynchronous cancellation token.

Parameters

NameTypeDescription
environment'envThe explicit environment supplied to the root workflow.
applicationFlow<'env, 'error, 'value>The root workflow to run.

Returns

Async<Exit<'value, 'error>>

runWithCancellation

App.runWithCancellation cancellationToken environment application
Member
Runs a root workflow to completion using an explicit host-owned cancellation token.

Parameters

NameTypeDescription
cancellationTokenCancellationTokenA host-owned token that requests application stop when cancelled.
environment'envThe explicit environment supplied to the root workflow.
applicationFlow<'env, 'error, 'value>The root workflow to run.

Returns

Async<Exit<'value, 'error>>