v0.11.2

Clients

Start New Workflows

Asynchronous dispatch

The asynchronous dispatch of a new workflow starts a new instance without waiting for its completion:

Asynchronous dispatch

We can start a new workflow using this stub:

The dispatch method returns when the ad-hoc message has been received by Pulsar. If we do not want to wait for this, we can use dispatchAsync instead:

This CompletableFuture returns when the ad-hoc message has been received by Pulsar.

The Deferred<T> object can be used to:

  • retrieve the underlying workflow's id:

  • wait for the synchronous completion:

    where T is the actual return type.

    The await() method blocks the current thread of the client - up to the workflow termination. It will throw an UnknownWorkflowException if the workflow is already terminated.

Synchronous dispatch

The synchronous dispatch of a new workflow starts a new instance and waits for its completion:

Synchronous dispatch

We can dispatch a workflow and wait for its completion synchronously using the stub of a new workflow:

When dispatching a workflow, the client serializes parameters and sends them through Pulsar to the [workflow worker, which will orchestrate the workflow. Eventually, the return value will be serialized and sent back to the client through Pulsar.

Previous
Workflow Stubs

New version 0.11.2!