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

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.

Summary

Types

t()

All the types that implement this protocol.

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

Types

@type item() :: any()
@type t() :: term()

All the types that implement this protocol.

@type work_list() :: any()

Functions

@spec count(work_list()) :: non_neg_integer()

Count the number of work items

Link to this function

count_pending(work_list)

View Source
@spec count_pending(work_list()) :: non_neg_integer()

Count the number of pending work items

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

Remove an item from the pending set

@spec empty?(work_list()) :: boolean()

Are there work items

@spec peek(work_list()) :: item()

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

@spec pending(work_list(), reference()) :: work_list()

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

@spec pop(work_list()) :: work_list()

Remove the current item from the work list

@spec push(work_list(), any()) :: work_list()

Push an item on the work list

@spec remove_all(work_list()) :: work_list()

Remove all work items

Link to this function

reset_pending(work_list)

View Source
@spec reset_pending(work_list()) :: work_list()

Empty out the set of pending items