View Source Dragonfly.Backend behaviour (dragonfly v0.1.4)

Defines a behavior for a Dragonfly backend.

A Dragonfly backend is responsible for booting remote compute resources, connecting them back to the parent node, and executing functions on them.

The default Dragonfly.LocalBackend simply runs your code locally, allowing you to development and test your application using Dragonfly.call/3 without running an external backend.

See Dragonfly.FlyBackend for an example implementation of this behavior.

Summary

Callbacks

Link to this callback

handle_info(msg, state)

View Source (optional)
@callback handle_info(msg :: term(), state :: term()) ::
  {:noreply, new_state :: term()} | {:stop, term(), new_state :: term()}
@callback init(opts :: Keyword.t()) :: {:ok, state :: term()} | {:error, term()}
@callback remote_boot(state :: term()) ::
  {:ok, remote_terminator_pid :: pid(), new_state :: term()} | {:error, term()}
Link to this callback

remote_spawn_monitor(state, func)

View Source
@callback remote_spawn_monitor(state :: term(), func :: function() | term()) ::
  {:ok, {pid(), reference()}} | {:error, reason :: term()}
@callback system_shutdown() :: no_return()

Functions