Module riak_core_vnode_worker_pool

This is a wrapper around a poolboy pool, that implements a queue.

Behaviours: gen_fsm.

Description

This is a wrapper around a poolboy pool, that implements a queue. That is, this process maintains a queue of work, and checks workers out of a poolboy pool to consume it.

The workers it uses send two messages to this process.

The first message is at startup, the bare atom worker_started. This is a clue to this process that a worker was just added to the poolboy pool, so a checkout request has a chance of succeeding. This is most useful after an old worker has exited - worker_started is a trigger guaranteed to arrive at a time that will mean an immediate poolboy:checkout will not beat the worker into the pool.

The second message is when the worker finishes work it has been handed, the two-tuple, {checkin, WorkerPid}. This message gives this process the choice of whether to give the worker more work or check it back into poolboy's pool at this point. Note: the worker should *never* call poolboy:checkin itself, because that will confuse (or cause a race) with this module's checkout management.

Function Index

code_change/4
handle_event/3
handle_info/3
handle_sync_event/4
handle_work/3
init/1
queueing/2
queueing/3
ready/2
ready/3
shutdown/2
shutdown/3
shutdown_pool/2
start_link/5
stop/2
terminate/3

Function Details

code_change/4

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

handle_event/3

handle_event(Event, StateName, State) -> any()

handle_info/3

handle_info(Info, StateName, State) -> any()

handle_sync_event/4

handle_sync_event(Event, From, StateName, State) -> any()

handle_work/3

handle_work(Pid, Work, From) -> any()

init/1

init(X1) -> any()

queueing/2

queueing(Msg, State) -> any()

queueing/3

queueing(Event, From, State) -> any()

ready/2

ready(Msg, State) -> any()

ready/3

ready(Event, From, State) -> any()

shutdown/2

shutdown(Event, State) -> any()

shutdown/3

shutdown(Event, From, State) -> any()

shutdown_pool/2

shutdown_pool(Pid, Wait) -> any()

start_link/5

start_link(WorkerMod, PoolSize, VNodeIndex, WorkerArgs, WorkerProps) -> any()

stop/2

stop(Pid, Reason) -> any()

terminate/3

terminate(Reason, StateName, State) -> any()


Generated by EDoc