ShieldedCache v1.3.1 ShieldedCache.TaskManager View Source

ShieldedCache.TaskManager

The TaskManager module is used to manage adding, getting, and finishing tasks. Specifically, in the ShieldedCache, the TaskManager manages all the fetch tasks for the cache.

Link to this section Summary

Link to this section Functions

Link to this function add_task(cache_name, task_reference, task) View Source
add_task(cache_name :: atom(), task_reference :: term(), task :: function()) ::
  :ok

add_task/3

Adds a task reference to the TaskSet of the specified cache.

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function finish_task(cache_name, task_reference) View Source
finish_task(cache_name :: atom(), task_reference :: term()) :: :ok

finish_task/2

Finishes a task reference in the TaskSet of the specified cache.

Link to this function get_tasks(cache_name) View Source
get_tasks(cache_name :: atom()) :: task_refs :: [{MapSet.t(), function()}]

get_tasks/1

Gets all of the current task references in the TaskSet of the specified cache.

Link to this function init(arg) View Source
init({cache_name :: module(), task_supervisor_name :: module()}) ::
  Supervisor.on_start()

init/1

Initializes the ShieldedCache.TaskManager Supervisor, which in turn starts the ShieldedCache.TaskManager.TaskSet module under the ShieldedCache.TaskManager supervision tree.

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

start_link/1

Starts the ShieldedCache.TaskManager Supervisor, which in turn starts the ShieldedCache.TaskManager.TaskSet module under the ShieldedCache.TaskManager supervision tree.