leo_pod

API of leo_pod.

References

Description

API of leo_pod

Function Index

checkin/2 Checkin the worker into the worker pool.
checkin_async/2 Checkin the worker into the worker pool assynchronously.
checkout/1 Checkout a worker from the worker pool.
start_link/6 Initialize a work pool.
status/1 Get the status of the worker pool.
stop/1 Stop the worker pool.

Function Details

checkin/2

checkin(PodName, Worker) -> ok

  • PodName = atom()
  • Worker = pid()

Checkin the worker into the worker pool.

checkin_async/2

checkin_async(PodName, Worker) -> ok

  • PodName = atom()
  • Worker = pid()

Checkin the worker into the worker pool assynchronously.

checkout/1

checkout(PodName) -> {ok, pid()}

  • PodName = atom()

Checkout a worker from the worker pool.

status/1

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

  • PodName = atom()
  • NumOfWorking = non_neg_integer()
  • NumOfWating = non_neg_integer()
  • NumOfRoomForOverflow = non_neg_integer()

Get the status of the worker pool. It returns the tuple of the numbers of working_processes, waiting processes, and room of overflow.

stop/1

stop(PodName) -> true | not_started

  • PodName = atom()

Stop the worker pool.