Package io.github.zero88.schedulerx
Interface FuturableJob<INPUT,OUTPUT,R,CTX>
- Type Parameters:
INPUT- Type of job inputOUTPUT- Type of job outputR- Type ofRxifiedexecution resultCTX- Type ofRxifiedexecution context
- All Known Subinterfaces:
CompletionStageJob<INPUT,,OUTPUT> MutinyJob<INPUT,,OUTPUT> io.github.zero88.schedulerx.rxjava3.Rx3Job<INPUT,,OUTPUT, T> Rx3MaybeJob<INPUT,,OUTPUT> Rx3SingleJob<INPUT,OUTPUT>
An interface supports reactive version for
Job.
This interface bridges you to write a new Job that based on your flavor async coding style and the reactive
library such as #reactivex or
#mutiny- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault io.vertx.core.Future<OUTPUT>asyncExecute(@NotNull JobData<INPUT> jobData, @NotNull ExecutionContext<OUTPUT> executionContext) Async execute jobAsync executetransformContext(@NotNull ExecutionContext<OUTPUT> executionContext) Transform execution context toRxifiedexecution contextio.vertx.core.Future<OUTPUT>transformResult(R result) Transform theRxifiedexecution result toVert.xFutureversion
-
Method Details
-
asyncExecute
default io.vertx.core.Future<OUTPUT> asyncExecute(@NotNull @NotNull JobData<INPUT> jobData, @NotNull @NotNull ExecutionContext<OUTPUT> executionContext) Description copied from interface:AsyncJobAsync execute jobWARNING: After execution, be aware to call a terminal operation of
Futuresuch asFuture.onSuccess(Handler),Future.onFailure(Handler)orFuture.onComplete(Handler). The async job is already registered these handlers, if severalhandlers are registered, there is no guarantee that they will be invoked in order of registration.- Specified by:
asyncExecutein interfaceAsyncJob<INPUT,OUTPUT> - Parameters:
jobData- job dataexecutionContext- job execution context- Returns:
- the job result in future
- See Also:
-
transformContext
Transform execution context toRxifiedexecution context- Parameters:
executionContext- job execution context- Returns:
Rxifiedexecution context- See Also:
-
transformResult
Transform theRxifiedexecution result toVert.xFutureversion- Parameters:
result-Rxifiedexecution result- Returns:
- the execution result in
Future
-
doExecute
Async execute- Parameters:
jobData- job dataexecutionContext- job execution context- Returns:
- the
Rxifiedexecution result
-