Pleroma Job Queue v0.3.0 PleromaJobQueue.Scheduler.Store behaviour View Source
Defines an interface for the store
Link to this section Summary
Callbacks
Retrieve all the jobs currently present in the store
Delete the jobs that are expired and send them to the execution queue
Initialize the store
Insert a scheduled job
Link to this section Callbacks
Link to this callback
all(store) View Source
Retrieve all the jobs currently present in the store.
Link to this callback
drain(store, timestamp)
View Source
drain(store, timestamp)
View Source
drain(store :: any(), timestamp :: pos_integer()) :: any()
drain(store :: any(), timestamp :: pos_integer()) :: any()
Delete the jobs that are expired and send them to the execution queue.
store
- a representation of the store.timestamp
- a unix timestamp past which the jobs should be considered expired.
Link to this callback
init(options) View Source
Initialize the store.
Link to this callback
insert(store, timestamp, job)
View Source
insert(store, timestamp, job)
View Source
insert(store :: any(), timestamp :: pos_integer(), job :: map()) ::
:ok | {:error, any()}
insert(store :: any(), timestamp :: pos_integer(), job :: map()) :: :ok | {:error, any()}
Insert a scheduled job.
store
- a representation of the storetimestamp
- a unix timestamp when the job should be enqueued to the execution queue.job
- a map that represents the job