Jackalope.WorkList protocol (jackalope v0.7.2) View Source

A work list manages work items that have yet to be sent out for processing, or have been sent out and are waiting for confirmation of completion.

Link to this section Summary

Functions

Count the number of work items

Count the number of pending work items

Remove an item from the pending set

Are there work items

Get the current item on the work list, if any. Leave it on the work list.

Move a work item to the pending set as it is being worked on, awaiting confirmation of completion.

Remove the current item from the work list

Push an item on the work list

Remove all work items

Empty out the set of pending items

Link to this section Types

Specs

item() :: any()

Specs

t() :: term()

Specs

work_list() :: any()

Link to this section Functions

Specs

count(work_list()) :: non_neg_integer()

Count the number of work items

Link to this function

count_pending(work_list)

View Source

Specs

count_pending(work_list()) :: non_neg_integer()

Count the number of pending work items

Specs

done(work_list(), reference()) :: {work_list(), item()}

Remove an item from the pending set

Specs

empty?(work_list()) :: boolean()

Are there work items

Specs

peek(work_list()) :: item()

Get the current item on the work list, if any. Leave it on the work list.

Specs

pending(work_list(), reference()) :: work_list()

Move a work item to the pending set as it is being worked on, awaiting confirmation of completion.

Specs

pop(work_list()) :: work_list()

Remove the current item from the work list

Specs

push(work_list(), any()) :: work_list()

Push an item on the work list

Specs

remove_all(work_list()) :: work_list()

Remove all work items

Link to this function

reset_pending(work_list)

View Source

Specs

reset_pending(work_list()) :: work_list()

Empty out the set of pending items