Behaviours: gen_fsm.
The builder starts and monitors the fitting processes.
This startup process is how each fitting learns about the fitting that follows it. The builder is also the process that the client asks to find the head fitting.abstract datatype: state()
code_change/4 | Unused. |
destroy/1 | Shutdown the pipeline built by this builder. |
fitting_pids/1 | Get the list of pids for fittings that this builder started. |
handle_event/3 | Unused. |
handle_info/3 | The only non-gen_fsm message this process expects are `DOWN'' messages from monitoring the fittings it has started. |
handle_sync_event/4 | The only sync event recognized in all states is fittings ,
which retrieves a count of fittings waiting to be started,
and pids for fittings already started. |
init/1 | Initialize the builder fsm (gen_fsm callback). |
pipeline/1 | Get the #pipe{} record describing the pipeline created by
this builder. |
start_link/2 | Start a builder to setup the pipeline described by Spec . |
terminate/3 | Terminate any fittings that are still alive. |
wait_pipeline_shutdown/2 | All fittings have been started, and the builder is just monitoring the pipeline (and replying to clients looking for the head fitting). |
wait_pipeline_shutdown/3 | A client is asking for the fittings. |
code_change(OldVsn::term(), StateName::atom(), State::state(), Extra::term()) -> {ok, atom(), state()}
Unused.
destroy(BuilderPid::pid()) -> ok
Shutdown the pipeline built by this builder.
fitting_pids(Builder::pid()) -> {ok, FittingPids::[pid()]} | gone
Get the list of pids for fittings that this builder started.
If the builder terminated before this call was made, the
function returns the atom gone
.
Unused.
handle_info(Info::{'DOWN', reference(), process, pid(), term()}, StateName::atom(), State::state()) -> {next_state, atom(), state()} | {stop, term(), state()}
The only non-gen_fsm message this process expects are `DOWN''
messages from monitoring the fittings it has started. When
normal `DOWN'' messages have been received from all monitored
fittings, this gen_fsm stops with reason normal
. If an
error `DOWN'' message is received for any fitting, this
process exits immediately, with an error reason.
handle_sync_event(Event::fittings, From::term(), StateName::atom(), State::state()) -> {reply, FittingPids::[pid()], StateName::atom(), state()}
The only sync event recognized in all states is fittings
,
which retrieves a count of fittings waiting to be started,
and pids for fittings already started.
init(X1::[[riak_pipe:fitting_spec()] | riak_pipe:exec_opts()]) -> {ok, wait_pipeline_shutdown, state()}
Initialize the builder fsm (gen_fsm callback).
pipeline(BuilderPid::pid()) -> {ok, #pipe{builder = undefined | pid(), fittings = undefined | [{Name::term(), #fitting{pid = undefined | pid(), ref = undefined | reference(), chashfun = undefined | riak_pipe_vnode:chashfun(), nval = undefined | riak_pipe_vnode:nval()}}], sink = undefined | #fitting{pid = undefined | pid(), ref = undefined | reference(), chashfun = undefined | riak_pipe_vnode:chashfun(), nval = undefined | riak_pipe_vnode:nval()}}} | gone
Get the #pipe{}
record describing the pipeline created by
this builder. This function will block until the builder has
finished building the pipeline.
start_link(Spec::[riak_pipe:fitting_spec()], Options::riak_pipe:exec_opts()) -> {ok, pid(), reference()} | ignore | {error, term()}
Start a builder to setup the pipeline described by Spec
.
terminate(Reason::term(), StateName::atom(), State::state()) -> ok
Terminate any fittings that are still alive.
wait_pipeline_shutdown(Event::term(), State::state()) -> {next_state, wait_pipeline_shutdown, state()}
All fittings have been started, and the builder is just monitoring the pipeline (and replying to clients looking for the head fitting).
wait_pipeline_shutdown(X1::pipeline | destroy, From::term(), State::state()) -> {reply, {ok, #pipe{builder = undefined | pid(), fittings = undefined | [{Name::term(), #fitting{pid = undefined | pid(), ref = undefined | reference(), chashfun = undefined | riak_pipe_vnode:chashfun(), nval = undefined | riak_pipe_vnode:nval()}}], sink = undefined | #fitting{pid = undefined | pid(), ref = undefined | reference(), chashfun = undefined | riak_pipe_vnode:chashfun(), nval = undefined | riak_pipe_vnode:nval()}}}, wait_pipeline_shutdown, state()} | {stop, normal, ok, state()}
A client is asking for the fittings. Respond.
Generated by EDoc, Jul 27 2012, 01:19:06.