logi_ex v0.1.1 Logi.SinkProc

Functions for sink processes.

A sink process manages the lifetime of a sink and a sink writer instance(Logi.SinkWriter).

Sink process is spawned at time a sink is installed in a channel (Logi.Channel.install_sink/2).

After spawned, the process should call send_writer_to_parent/1 to notify available writer instance to the parent.

If the root sink process exits, the associated sink is uninstalled from the channel.

Summary

Types

The supervisor of a sink process

Functions

Receives a sink writer instance from the child sink process sink_sup

Sends writer to the parent sink process

Starts a new child sink process

Stops the sink process

Types

sink_sup()
sink_sup() :: pid

The supervisor of a sink process.

Functions

recv_writer_from_child(sink_sup, timeout)
recv_writer_from_child(sink_sup, timeout) ::
  Logi.SinkWriter.writer |
  :undefined

Receives a sink writer instance from the child sink process sink_sup.

send_writer_to_parent(writer)
send_writer_to_parent(Sink.SinkWriter.writer | :undefined) :: :ok

Sends writer to the parent sink process.

The message {:sink_writer, sink_sup, Logi.SinkWriter.writer} is sent to the parent.

NOTICE: This function can only be invoked in a sink process.

start_child(sink)
start_child(Logi.Sink.sink) :: {:ok, sink_sup} | {:error, any}

Starts a new child sink process.

NOTICE: This function can only be invoked in a sink process.

stop_child(sink_sup)
stop_child(sink_sup) :: :ok

Stops the sink process.

NOTICE: This function can only be invoked in a sink process.