Module leo_pod_manager

leo_pod_manager can manage worker pools in the pod.

Behaviours: gen_server.

References

Description

leo_pod_manager can manage worker pools in the pod

Function Index

checkin/2Check in a worker to the woker pool.
checkin_async/2Check in a worker to the worker pool with asynchronous.
checkout/1Check out a worker from the worker pool.
close/1Retrieve pids of specified PodName.
code_change/3gen_server callback - Module:code_change(OldVsn, State, Extra) -> {ok, NewState} | {error, Reason}.
handle_call/3gen_server callback - Module:handle_call(Request, From, State) -> Result.
handle_cast/2gen_server callback - Module:handle_cast(Request, State) -> Result.
handle_info/2gen_server callback - Module:handle_info(Info, State) -> Result.
init/1gen_server callback - Module:init(Args) -> Result.
pool_pids/1Retrieve pids of specified PodName.
raw_status/1Retrieve a raw status of specified PodName.
start_link/6Initialize a wooker pool.
status/1Retrieve the current status in pretty format as follows: format: { working_process_count, worker_process_count, overflow_count }.
stop/1Stop the worker pool.
terminate/2gen_server callback - Module:terminate(Reason, State).

Function Details

checkin/2

checkin(PodName, WorkerPid) -> ok | {error, any()}

Check in a worker to the woker pool

checkin_async/2

checkin_async(PodName, WorkerPid) -> ok

Check in a worker to the worker pool with asynchronous

checkout/1

checkout(PodName) -> {ok, pid()} | {error, empty}

Check out a worker from the worker pool

close/1

close(PodName) -> ok | {error, any()}

Retrieve pids of specified PodName

code_change/3

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

gen_server callback - Module:code_change(OldVsn, State, Extra) -> {ok, NewState} | {error, Reason}

Description: Convert process state when code is changed

handle_call/3

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

gen_server callback - Module:handle_call(Request, From, State) -> Result

handle_cast/2

handle_cast(X1, State) -> any()

gen_server callback - Module:handle_cast(Request, State) -> Result

handle_info/2

handle_info(Info, State) -> any()

gen_server callback - Module:handle_info(Info, State) -> Result

init/1

init(X1) -> any()

gen_server callback - Module:init(Args) -> Result

pool_pids/1

pool_pids(PodName) -> {ok, [pid()]} | {error, any()}

Retrieve pids of specified PodName

raw_status/1

raw_status(PodName) -> {ok, [tuple()]} | {error, any()}

Retrieve a raw status of specified PodName

start_link/6

start_link(PodName, NumOfChildren, MaxOverflow, WorkerMod, WorkerArgs, InitFun) -> {ok, pid()} | ignore | {error, any()}

Initialize a wooker pool

status/1

status(PodName) -> {ok, {NumOfWorking, NumOfWating, NumOfRoomForOverflow}}

Retrieve the current status in pretty format as follows: format: { working_process_count, worker_process_count, overflow_count }

stop/1

stop(PodName) -> ok | {error, any()}

Stop the worker pool

terminate/2

terminate(Reason, State) -> any()

gen_server callback - Module:terminate(Reason, State)

Description: This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.


Generated by EDoc