Erl2ex v0.0.9 Erl2ex.Results.Collector

Erl2ex.Results.Collector is a process that accumulates results of a conversion run.

Summary

Types

A file identifier, which may be a filesystem path or a symbolic id

t()

The ProcessID of a results collector process

Functions

Returns the results for the entire conversion so far

Returns the results for the given input path

Record that a conversion was unsuccessful for the given input path

Record that a conversion was successful for the given input and output paths

Starts a result collector and returns its PID

Stops the collector process

Types

file_id :: Path.t | atom

A file identifier, which may be a filesystem path or a symbolic id.

t :: pid

The ProcessID of a results collector process.

Functions

get(results)

Specs

Returns the results for the entire conversion so far.

get_file(results, path)

Specs

get_file(t, file_id) ::
  {:ok, Erl2ex.Results.File.t} |
  {:error, term}

Returns the results for the given input path.

put_error(results, input_path, error)

Specs

put_error(t, file_id, %CompileError{__exception__: term, description: term, file: term, line: term}) ::
  :ok |
  {:error, term}

Record that a conversion was unsuccessful for the given input path.

put_success(results, input_path, output_path)

Specs

put_success(t, file_id, file_id) ::
  :ok |
  {:error, term}

Record that a conversion was successful for the given input and output paths.

start_link(opts \\ [])

Specs

start_link(list) :: t

Starts a result collector and returns its PID.

stop(results)

Specs

stop(t) :: :ok

Stops the collector process.