Chronicle.Task (chronicle v0.1.2)

Copy Markdown

Task helpers that propagate the current audit context and active group.

Tasks started inside a group must be awaited before the group function returns. A task cannot append to a group after that group has closed.

Summary

Functions

async(fun)

@spec async((-> result)) :: Task.t() when result: term()

async_stream(enumerable, fun, opts \\ [])

@spec async_stream(Enumerable.t(), (term() -> term()), keyword()) :: Enumerable.t()

async_stream(supervisor, enumerable, fun, opts)

@spec async_stream(
  Supervisor.supervisor(),
  Enumerable.t(),
  (term() -> term()),
  keyword()
) :: Enumerable.t()

start(fun)

@spec start((-> result)) :: {:ok, pid()} | {:error, term()} when result: term()

start_link(fun)

@spec start_link((-> result)) :: {:ok, pid()} | {:error, term()} when result: term()

wrap(fun)

@spec wrap((-> result)) :: (-> result) when result: term()