pollin v0.2.1 Pollin.Backend.Memory.CallbackWorker

Worker for callbacks

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Count all callbacks of an endpoint

Count all callbacks of an endpoint with filter options

Remove a callback

Dump all callbacks of an endpoint

Pop a callback from endpoint

Fetch list of callbacks from endpoint queue by given offset and limit

Fetch reverse list of callbacks from endpoint queue by given offset and limit

Pop a callback from endpoint

Pop list of callbacks from endpoint queue by given options offset and limit

Push a callback resource to an endpoint

Reset all callbacks of an endpoint

Update phase of a callback

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Count all callbacks of an endpoint

Example

count = CallbackWorker.count(id)
Link to this function

count(id, opts)

Count all callbacks of an endpoint with filter options

Example

count = CallbackWorker.count(id, %{phase: "unprocessed"})
Link to this function

delete(id, key)

Remove a callback

Example

CallbackWorker.delete(id, key)

Dump all callbacks of an endpoint

Example

callbacks = CallbackWorker.count(id)

Pop a callback from endpoint

Example

callback = CallbackWorker.fetch(id)

Fetch list of callbacks from endpoint queue by given offset and limit

Example

callbacks = CallbackWorker.fetch(id, opts)
Link to this function

fetch_reverse(id, opts)

Fetch reverse list of callbacks from endpoint queue by given offset and limit

Example

callbacks = CallbackWorker.fetch(id, opts)

Pop a callback from endpoint

Example

callback = CallbackWorker.pop(id)

Pop list of callbacks from endpoint queue by given options offset and limit

Example

callbacks = CallbackWorker.pop(id, opts)
Link to this function

push(id, callback, secret \\ "")

Push a callback resource to an endpoint

Example

CallbackWorker.push(id, %Pollin.Resource.Callback{})

Reset all callbacks of an endpoint

Example

CallbackWorker.reset(id)
Link to this function

update_phase(id, key, phase)

Update phase of a callback

Example

CallbackWorker.update_phase(id, key, phase)