Start a long-running backend task without blocking the caller.
Launches command via invoke() and returns a taskId immediately.
Use pollTask(taskId) to query current state and cancelTask(taskId) to
signal cancellation before the task completes.
The optional options.onCancel callback is invoked when cancelTask()
is called, allowing the consumer to propagate cancellation to the
backend (e.g. by invoking a cancel command).
Start a long-running backend task without blocking the caller.
Launches
commandvia invoke() and returns a taskId immediately. Use pollTask(taskId) to query current state and cancelTask(taskId) to signal cancellation before the task completes.The optional
options.onCancelcallback is invoked when cancelTask() is called, allowing the consumer to propagate cancellation to the backend (e.g. by invoking a cancel command).