Package ru.yoomoney.tech.dbqueue.api
Interface QueueConsumer<PayloadT>
-
- Type Parameters:
PayloadT- The type of the payload in the task
public interface QueueConsumer<PayloadT>Task processor for the queue- Since:
- 09.07.2017
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TaskExecutionResultexecute(Task<PayloadT> task)Process the task from the queuedefault java.util.Optional<java.util.concurrent.Executor>getExecutor()Task executor forProcessingMode.USE_EXTERNAL_EXECUTORmode.TaskPayloadTransformer<PayloadT>getPayloadTransformer()Get task payload transformer, which transform the task's String payload into the type of the taskQueueConfiggetQueueConfig()Get queue configuration
-
-
-
Method Detail
-
execute
@Nonnull TaskExecutionResult execute(@Nonnull Task<PayloadT> task)
Process the task from the queue- Parameters:
task- A typed task for processing- Returns:
- A result of task processing
-
getQueueConfig
@Nonnull QueueConfig getQueueConfig()
Get queue configuration- Returns:
- Queue configuration
-
getPayloadTransformer
@Nonnull TaskPayloadTransformer<PayloadT> getPayloadTransformer()
Get task payload transformer, which transform the task's String payload into the type of the task- Returns:
- Task payload transformer
-
getExecutor
default java.util.Optional<java.util.concurrent.Executor> getExecutor()
Task executor forProcessingMode.USE_EXTERNAL_EXECUTORmode. Applies only to that mode- Returns:
- Optional of external task executor
-
-