GenMagic.Helpers (GenMagic v1.1.1) View Source

Contains convenience functions for one-off use.

Link to this section Summary

Functions

Runs a one-shot process without supervision.

Link to this section Functions

Link to this function

perform_once(path, options \\ [])

View Source

Specs

perform_once(Path.t(), [GenMagic.Server.option()]) ::
  {:ok, GenMagic.Result.t()} | {:error, term()}

Runs a one-shot process without supervision.

Useful in tests, but not recommended for actual applications.

Example

iex(1)> {:ok, result} = GenMagic.Helpers.perform_once(".")
iex(2)> result
%GenMagic.Result{content: "directory", encoding: "binary", mime_type: "inode/directory"}