Module pooler_starter

Helper gen_server to start pool members.

Copyright © 2012-2013 Seth Falcon

Behaviours: gen_server.

Authors: Seth Falcon (seth@userprimary.net).

Description

Helper gen_server to start pool members

Data Types

parent()

parent() = pid() | pool

pool_member_sup()

pool_member_sup() = pid() | atom()

start_result()

start_result() = {StarterPid::pid(), Result::pid() | {error, term()}}

start_spec()

abstract datatype: start_spec()

Function Index

code_change/3
handle_call/3
handle_cast/2
handle_continue/2
handle_info/2
init/1
start_link/1
start_member/2Start a member for the specified Pool.
start_member/3Same as start_member/1 except that instead of calling pooler:accept_member/2 a raw message is sent to Parent of the form {accept_member, {Ref, Member}.
stop/1
stop_member_async/1Stop a member in the pool.
terminate/2

Function Details

code_change/3

code_change(OldVsn::term(), State::term(), Extra::term()) -> {ok, term()}

handle_call/3

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

handle_cast/2

handle_cast(Request, Starter) -> any()

handle_continue/2

handle_continue(X1, Starter) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(X1::start_spec()) -> {ok, #starter{parent = parent(), pool_name = pooler:pool_name(), pool_member_sup = pool_member_sup(), msg = start_result() | undefined}, {continue, start}}

start_link/1

start_link(Spec::start_spec()) -> {ok, pid()}

start_member/2

start_member(PoolName::pooler:pool_name(), PoolMemberSup::pool_member_sup()) -> pid()

Start a member for the specified Pool.

Member creation with this call is async. This function returns immediately with create process' pid. When the member has been created it is sent to the specified pool via pooler:accept_member/2.

Each call starts a single use pooler_starter instance via pooler_starter_sup. The instance terminates normally after creating a single member.

start_member/3

start_member(PoolName::pooler:pool_name(), PoolMemberSup::pool_member_sup(), Parent::pid()) -> pid()

Same as start_member/1 except that instead of calling pooler:accept_member/2 a raw message is sent to Parent of the form {accept_member, {Ref, Member}. Where Member will either be the member pid or an error term and Ref will be the Pid of the starter.

This is used by the init function in the pooler to start the initial set of pool members in parallel.

stop/1

stop(Starter) -> any()

stop_member_async/1

stop_member_async(Pid::pid()) -> ok

Stop a member in the pool

terminate/2

terminate(Reason::term(), State::term()) -> ok


Generated by EDoc