View Source Honeycomb (honeycomb v0.1.1)

A scheduling system and result collection center for asynchronous/background tasks.

Summary

Types

@type bad_cancel_status() :: :running | :done | :raised | :terminated | :canceled
@type bad_gather_status() :: :running | :pending
@type bad_gather_sync() :: {:exception, Exception.t()} | {:error, :sync_timeout}
@type gather_opts() :: [stateless: boolean(), delay: non_neg_integer()]
@type gather_sync_opts() :: [timeout: timeout(), delay: non_neg_integer()]
@type name() :: String.t()
@type naming() :: name() | :anon
@type queen() :: atom()

Functions

@spec bee(atom(), name()) :: Honeycomb.Bee.t() | nil
@spec bees(atom()) :: [Honeycomb.Bee.t()]
@spec cancel_bee(queen(), name()) ::
  {:ok, Honeycomb.Bee.t()} | {:error, :not_found | bad_cancel_status()}
Link to this function

gather_honey(queen, name, run, opts \\ [])

View Source
@spec gather_honey(queen(), naming(), Honeycomb.Bee.run(), gather_opts()) ::
  {:ok, Honeycomb.Bee.t()} | {:error, bad_gather_status()}
Link to this function

gather_honey_after(queen, name, run, millisecond, opts \\ [])

View Source
@spec gather_honey_after(
  queen(),
  naming(),
  Honeycomb.Bee.run(),
  non_neg_integer(),
  gather_opts()
) :: {:ok, Honeycomb.Bee.t()} | {:error, bad_gather_status()}
Link to this function

gather_honey_sync(queen, name, run, opts \\ [])

View Source
@spec gather_honey_sync(queen(), naming(), Honeycomb.Bee.run(), gather_sync_opts()) ::
  bad_gather_sync() | any()
Link to this function

harvest_honey(queen, name)

View Source
@spec harvest_honey(atom(), name()) ::
  {:done, any()} | {:raised, Exception.t()} | {:error, :not_found | :undone}
@spec stop_bee(queen(), name()) ::
  {:ok | :ignore, Honeycomb.Bee.t()} | {:error, :not_found}
Link to this function

terminate_bee(queen, name)

View Source
@spec terminate_bee(queen(), name()) ::
  {:ok, Honeycomb.Bee.t()} | {:error, :not_found | :task_not_found}