Package com.netflix.eureka.util.batcher
Interface TaskDispatcher<ID,T>
-
public interface TaskDispatcher<ID,T>Task dispatcher takes task from clients, and delegates their execution to a configurable number of workers. The task can be processed one at a time or in batches. Only non-expired tasks are executed, and if a newer task with the same id is scheduled for execution, the old one is deleted. Lazy dispatch of work (only on demand) to workers, guarantees that data are always up to date, and no stale task processing takes place.Task processor
A client of this component must provide an implementation ofTaskProcessorinterface, which will do the actual work of task processing. This implementation must be thread safe, as it is called concurrently by multiple threads.Execution modes
To create non batched executor callTaskDispatchers#createNonBatchingTaskDispatcher(String, int, int, long, long, TaskProcessor)method. Batched executor is created byTaskDispatchers#createBatchingTaskDispatcher(String, int, int, int, long, long, TaskProcessor).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidprocess(ID id, T task, long expiryTime)voidshutdown()
-