durable-queue documentation

->Task

fn

[slab offset length status deserializer]

Positional factory function for class durable_queue.Task.

->TaskSlab

fn

[filename q-name queue buf position lock dirty]

Positional factory function for class durable_queue.TaskSlab.

IQueues

var

ITask

var

ITaskSlab

var

complete!

fn

[task]

Marks a task as complete.

create-buffer

fn

[filename size]

delete!

fn

[_]

Deletes all files associated with the queues.

fsync

fn

[_]

Forces an fsync on all modified files.

immediate-task-seq

fn

[qs q-name]

Returns a finite lazy sequence of tasks for q-name which terminates once there are no more tasks immediately available.

interval-task-seq

fn

[qs q-name interval]

Returns a lazy sequence of tasks that can be consumed in interval milliseconds. This will terminate after that time has elapsed, even if there are still tasks immediately available.

load-buffer

fn

[filename]
[filename offset length]

map->Task

fn

[m__5818__auto__]

Factory function for class durable_queue.Task, taking a map of keywords to field values.

put!

fn

[_ q-name task-descriptor]
[_ q-name task-descriptor timeout]

A blocking enqueue to name. If timeout is specified, returns false if unable to enqueue within timeout milliseconds.

queues

fn

[directory]
[directory {:keys [max-queue-size complete? slab-size fsync-put? fsync-take? fsync-threshold fsync-interval], :or {max-queue-size Integer/MAX_VALUE, complete? nil, slab-size (* 64 1024 1024), fsync-put? true, fsync-take? false}}]

Creates a point of interaction for queues, backed by disk storage in directory.

The following options can be specified:

max-queue-size - the maximum number of elements that can be in the queue before `put!`
                 blocks.  Defaults to `Integer/MAX_VALUE`.

complete? - a predicate that is run on pre-existing tasks to check if they were already
            completed.  If the tasks in the queue are non-idempotent, this must be
            specified for correct behavior.  Defaults to always returning false.

slab-size - The size, in bytes, of the backing files for the queue.  Defaults to 16mb.

fsync-put? - if true, each `put!` will force an fsync.  Defaults to true.

fsync-take? - if true, each `take!` will force an fsync.  Defaults to false.

retry!

fn

[task]

Marks a task as available for retry.

stats

fn

[_]

Returns a map of queue names onto information about the immediate state of the queue.

take!

fn

[_ q-name]
[_ q-name timeout timeout-val]

A blocking dequeue from name. If timeout is specified, returns timeout-val if no task is available within timeout milliseconds.

task-seq

fn

[qs q-name]

Returns an infinite lazy sequence of tasks for q-name.