Module z_buffered_worker

A worker which gets its jobs from an ets buffer.

Copyright © 2015 Maas-Maarten Zeeman

Behaviours: gen_server.

Authors: Maas-Maarten Zeeman (mmzeeman@xs4all.nl).

Description

A worker which gets its jobs from an ets buffer.

Function Index

code_change/3
flush/1Flush the worker,.
handle_call/3
handle_cast/2
handle_info/2
init/1
push/2Push a message to the named worker, when the worker is flushed the pushed messages are handled in-order.
start_link/3Start the worker, the handler module will be called when new data entries are pushed in the buffer.
stop/1Stop the worker, all pending work will be lost.
terminate/2

Function Details

code_change/3

code_change(OldVsn, State, Extra) -> any()

flush/1

flush(Name::atom()) -> ok | {error, badarg}

Flush the worker,

handle_call/3

handle_call(Request, From, State) -> any()

handle_cast/2

handle_cast(Msg, State) -> any()

handle_info/2

handle_info(X1, State) -> any()

init/1

init(X1) -> any()

push/2

push(Name::atom(), Msg::term()) -> true

Push a message to the named worker, when the worker is flushed the pushed messages are handled in-order.

start_link/3

start_link(Name::atom(), Handler::module(), Args::term()) -> {ok, pid()} | {error, term()}

Start the worker, the handler module will be called when new data entries are pushed in the buffer.

The server calls Handler:init(pid(), Args) -> {ok, Timeout, HandlerState} when it is started. Timeout will be used as flush interval.

stop/1

stop(Name::atom()) -> ok

Stop the worker, all pending work will be lost.

terminate/2

terminate(Reason, State) -> any()


Generated by EDoc