Module logi_sink_proc

Functions for sink processes.

Copyright © 2014-2016 Takeru Ohta <phjgt308@gmail.com>

Description

Functions for sink processes

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

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.

Data Types

sink_sup()

sink_sup() = pid()

The supervisor of a sink process

Function Index

recv_writer_from_child/2Receives a sink writer instance from the child sink process SinkSup
send_writer_to_parent/1Sends Writer to the parent sink process.
start_child/1Starts a new child sink process.
stop_child/1Stops the sink process.

Function Details

recv_writer_from_child/2

recv_writer_from_child(SinkSup::sink_sup(), Timeout::timeout()) -> logi_sink_writer:writer() | undefined

Receives a sink writer instance from the child sink process SinkSup

send_writer_to_parent/1

send_writer_to_parent(Writer::logi_sink_writer:writer() | undefined) -> ok

Sends Writer to the parent sink process

The message {sink_writer, sink_sup(), Writer} is sent to the parent.

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

start_child/1

start_child(Sink::logi_sink:sink()) -> {ok, sink_sup()} | {error, Reason::term()}

Starts a new child sink process

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

stop_child/1

stop_child(SinkSup::sink_sup()) -> ok

Stops the sink process

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


Generated by EDoc