ASDF.Handle (asdf v0.1.0)

Copy Markdown View Source

An open ASDF source.

The struct holds the pid of the process that keeps the file descriptor and the parsed tree. ASDF.close/1 closes the descriptor and stops that process. Further calls return {:error, %ASDF.Error{reason: :closed}}.

Examples

iex> bytes = ASDF.write!(:binary, %{"n" => 1})
...> handle = ASDF.open!({:binary, bytes})
...> alive = is_pid(handle.pid) and Process.alive?(handle.pid)
...> ASDF.close(handle)
...> {alive, Process.alive?(handle.pid)}
{true, false}

Summary

Types

t()

One open file.

Types

t()

@type t() :: %ASDF.Handle{pid: pid()}

One open file.

  • :pid — process that holds the descriptor and the parsed tree