TaskServer (fnord v0.8.27)
View SourceSummary
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for GenServer.init/1
.
Types
@type t() :: %TaskServer{ lists: %{required(non_neg_integer()) => [task()]}, next_id: non_neg_integer() }
@type task() :: %{ id: non_neg_integer() | binary(), outcome: :todo | :done | :failed, data: any(), result: any() }
Functions
@spec add_task(non_neg_integer(), binary(), any()) :: :ok
@spec as_string(non_neg_integer() | [task()], boolean()) :: binary()
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec complete_task(non_neg_integer(), binary(), any()) :: :ok
@spec fail_task(non_neg_integer(), binary(), any()) :: :ok
@spec get_list(non_neg_integer()) :: [task()] | {:error, :not_found}
Callback implementation for GenServer.init/1
.
@spec start_link(any()) :: GenServer.on_start()
@spec start_list() :: non_neg_integer()