public interface ExecBuilder
execution
.Execution.fork()
Modifier and Type | Method and Description |
---|---|
ExecBuilder |
eventLoop(EventLoop eventLoop)
Specifies that the execution must run on the given event loop.
|
ExecBuilder |
onComplete(Action<? super Execution> onComplete)
Specifies the completion callback for the execution.
|
ExecBuilder |
onError(Action<? super Throwable> onError)
Specify the top level error handler for the execution.
|
ExecBuilder |
onError(BiAction<? super Execution,? super Throwable> onError)
Specify the top level error handler for the execution.
|
ExecBuilder |
onStart(Action<? super Execution> onStart)
Specifies an action to be taken just before the execution starts.
|
ExecBuilder |
register(Action<? super RegistrySpec> action)
Populates the execution's registry.
|
void |
start(Action<? super Execution> action)
Initiate the new execution.
|
ExecBuilder onError(Action<? super Throwable> onError)
onError
- the top level error handler for the executionthis
onError(BiAction)
ExecBuilder onError(BiAction<? super Execution,? super Throwable> onError)
The given action will be called if an exception is raised during execution that is not caught.
This method is not additive. That is, any subsequent calls replace the previous value.
onError
- the top level error handler for the executionthis
onError(BiAction)
ExecBuilder onComplete(Action<? super Execution> onComplete)
The given action will effectively execute outside of the execution. The action is expected to be synchronous and cannot perform async operations. During its execution, there will be no thread bound execution or execution control. Any exceptions raised will be logged.
This method should be used as a last resort.
The action will be invoked regardless of whether the execution completed with an error or not. If the execution did complete with an error, the given action will be invoked after the error handler.
This method is not additive. That is, any subsequent calls replace the previous value.
onComplete
- the action to invoke when the execution completes.this
ExecBuilder onStart(Action<? super Execution> onStart)
The action will be invoked after the execution registry has been populated.
This method is not additive. That is, any subsequent calls replace the previous value.
onStart
- the action to invoke just before the execution startsthis
ExecBuilder register(Action<? super RegistrySpec> action)
This method is not additive. That is, any subsequent calls replace the previous value.
action
- the initial contents of the execution's registry.this
ExecBuilder eventLoop(EventLoop eventLoop)
If this method is not called, an event loop will be automatically assigned from the exec controller's event loop group
.
It is generally not required, or desirable, to call this method.
eventLoop
- the event loop to use for the executionthis
@NonBlocking void start(Action<? super Execution> action)
This method effectively returns immediately, with the forked execution occurring on a separate thread.
action
- the initial execution segment of the execution