Package ru.yoomoney.tech.dbqueue.dao
Interface QueueDao
-
public interface QueueDaoDatabase access object to manage tasks in the queue.- Since:
- 06.10.2019
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleandeleteTask(QueueLocation location, long taskId)Remove (delete) task from the queue.longenqueue(QueueLocation location, EnqueueParams<java.lang.String> enqueueParams)Add a new task in the queue for processing.booleanreenqueue(QueueLocation location, long taskId, java.time.Duration executionDelay)Postpone task processing for given time period (current date and time plus execution delay).
-
-
-
Method Detail
-
enqueue
long enqueue(@Nonnull QueueLocation location, @Nonnull EnqueueParams<java.lang.String> enqueueParams)Add a new task in the queue for processing.- Parameters:
location- Queue location.enqueueParams- Parameters of the task- Returns:
- Identifier (sequence id) of new inserted task.
-
deleteTask
boolean deleteTask(@Nonnull QueueLocation location, long taskId)Remove (delete) task from the queue.- Parameters:
location- Queue location.taskId- Identifier (sequence id) of the task.- Returns:
- true, if task was deleted from database, false, when task with given id was not found.
-
reenqueue
boolean reenqueue(@Nonnull QueueLocation location, long taskId, @Nonnull java.time.Duration executionDelay)Postpone task processing for given time period (current date and time plus execution delay).- Parameters:
location- Queue location.taskId- Identifier (sequence id) of the task.executionDelay- Task execution delay.- Returns:
- true, if task was successfully postponed, false, when task was not found.
-
-