tarearbol v0.4.1 Tarearbol

Tarearbol module provides an interface to run tasks in easy way.

Examples

iex> result = Tarearbol.ensure(fn -> raise "¡?" end, attempts: 1, raise: false)
iex> {:error, %{job: _job, outcome: outcome}} = result
iex> {error, _stacktrace} = outcome
iex> error
%RuntimeError{message: "¡?"}

Link to this section Summary

Link to this section Functions

Link to this function drain()
drain() :: [error: any, ok: any]
Link to this function ensure(job, opts \\ [])
ensure(Function.t | {Module.t, Atom.t, List.t}, Keyword.t) ::
  {:error, any} |
  {:ok, any}
Link to this function ensure!(job, opts \\ [])
ensure!(Function.t | {Module.t, Atom.t, List.t}, Keyword.t) ::
  {:error, any} |
  {:ok, any}
Link to this function ensure_all(jobs, opts \\ [])
ensure_all([Function.t | {Module.t, Atom.t, List.t}], Keyword.t) :: [error: any, ok: any]
Link to this function ensure_all_streamed(jobs, opts \\ [])
ensure_all_streamed([Function.t | {Module.t, Atom.t, List.t}], Keyword.t) :: [Stream.t]
Link to this function run_at(job, at, opts \\ [])
run_at(Function.t | {Module.t, Atom.t, List.t}, DateTime.t | String.t, Keyword.t) :: Task.t
Link to this function run_in(job, interval, opts \\ [])
run_in(Function.t | {Module.t, Atom.t, List.t}, Atom.t | Integer.t | Float.t, Keyword.t) :: Task.t
Link to this function spawn(job, opts \\ [])
spawn(Function.t | {Module.t, Atom.t, List.t}, Keyword.t) :: Task.t