ObserverWeb.Apps.Helper (Observer Web v0.1.5)

Helper functions and JSON encoders.

References:

Summary

Functions

Formats function information as readable string.

Parallel map implemented with Task.

Functions

format_function(name)

@spec format_function(nil | {atom(), atom(), integer()} | atom()) :: String.t() | nil

Formats function information as readable string.

Only name will be return if only name is given.

Examples

iex> alias ObserverWeb.Apps.Helper ...> assert "Elixir.Logger.log/2" == Helper.format_function({Logger, :log, 2}) ...> assert "format_function" == Helper.format_function(:format_function) ...> assert nil == Helper.format_function(nil)

parallel_map(enum, function)

@spec parallel_map(enum :: list(), function :: (... -> any())) :: list()

Parallel map implemented with Task.

Maps the function over the enum using Task.async/1 and Task.await/1.