ShieldedCache v1.1.1 ShieldedCache.TaskManager.TaskSet View Source

ShieldedCache.TaskManager.TaskSet

A GenServer process that holds in it’s state a unique set of tasks.

The TaskSet defines functions to add task refs, finish task refs, and get all the current task refs.

Link to this section Summary

Types

A representation of the state of the TaskSet

A representation of the tasks saved in the TaskSet state

Link to this section Types

A representation of the state of the TaskSet

Link to this type task() View Source
task() :: {reference :: term(), task :: function()}

A representation of the tasks saved in the TaskSet state

Link to this section Functions

Link to this function add_task(task_set, task_ref, task) View Source
add_task(task_set :: atom() | pid(), task_ref :: term(), task :: function()) ::
  :ok

add_task/2

Adds a task reference to the specified task set.

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function finish_task(task_set, task_ref) View Source
finish_task(task_set :: atom() | pid(), task_ref :: term()) :: :ok

finish_task/2

Finishes the specified task reference in the specified task set.

Link to this function get_tasks(task_set) View Source
get_tasks(task_set :: atom() | pid()) :: task_refs :: [task()]

get_tasks/1

Gets all of the task references in the specified task set.

Link to this function start_link(opts \\ []) View Source
start_link(opts :: Keyword.t()) :: GenServer.on_start()

start_link/1

Starts the TaskSet.