Package io.github.zero88.schedulerx
Interface Job<INPUT,OUTPUT>
- Type Parameters:
INPUT
- Type of job input dataOUTPUT
- Type of job result data
- All Known Subinterfaces:
AsyncJob<INPUT,
,OUTPUT> CompletionStageJob<INPUT,
,OUTPUT> FuturableJob<INPUT,
,OUTPUT, R, CTX> MutinyJob<INPUT,
,OUTPUT> io.github.zero88.schedulerx.rxjava3.Rx3Job<INPUT,
,OUTPUT, T> Rx3MaybeJob<INPUT,
,OUTPUT> Rx3SingleJob<INPUT,
,OUTPUT> SyncJob<INPUT,
OUTPUT>
public interface Job<INPUT,OUTPUT>
Represents for Job to run on each trigger time.
It is ideal if your concrete class is a class that has a constructor without argument, which makes it easier to init
a new job object in runtime via the configuration from an external system.
If you want to use the job that returns Vertx
Future
, please using AsyncJob
for more intuitive API.- Since:
- 1.0.0
- API Note:
- This interface is renamed from
Task
since2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(@NotNull JobData<INPUT> jobData, @NotNull ExecutionContext<OUTPUT> executionContext) Execute job.
-
Method Details
-
execute
void execute(@NotNull @NotNull JobData<INPUT> jobData, @NotNull @NotNull ExecutionContext<OUTPUT> executionContext) Execute job. After executed job, please remember to:- set value in case of job is success via
ExecutionContext.complete(Object)
- set error in case of job is failed via
ExecutionContext.fail(Throwable)
- Parameters:
jobData
- job dataexecutionContext
- job execution context- See Also:
- set value in case of job is success via
-