Cairn.Task (cairn v0.1.3)

Copy Markdown View Source

Supervised task helper for use inside Cairn server callbacks.

Summary

Functions

Runs work and routes its result back to handle_task/3.

Types

fun()

@type fun() :: (-> value())

reason()

@type reason() :: term()

ref()

@type ref() :: Cairn.Message.ref()

result()

@type result() :: {:ok, value()} | {:error, reason()}

value()

@type value() :: term()

Functions

run(ref, fun)

@spec run(ref(), fun()) :: {:ok, pid()}

Runs work and routes its result back to handle_task/3.