Packages

Typed distributed messaging for Gleam on the BEAM.

Retired package: Deprecated - The project needs to be redesigned around a much smaller and clearer core.

Current section

Files

Jump to
distribute src monitor_ffi.erl
Raw

src/monitor_ffi.erl

%% Monitor FFI for Gleam distribute library
-module(monitor_ffi).
-export([to_atom/1]).
to_atom(Bin) when is_binary(Bin) ->
case catch binary_to_existing_atom(Bin, utf8) of
{'EXIT', _} -> binary_to_atom(Bin, utf8);
Atom -> Atom
end;
to_atom(List) when is_list(List) -> to_atom(list_to_binary(List));
to_atom(Atom) when is_atom(Atom) -> Atom.