Module sidejob_worker

This module implements the sidejob_worker logic used by all worker processes created to manage a sidejob resource.

Behaviours: gen_server.

Description

This module implements the sidejob_worker logic used by all worker processes created to manage a sidejob resource. This code emulates the gen_server API, wrapping a provided user-specified module which implements the gen_server behavior.

The primary purpose of this module is updating the usage information published in a given resource's ETS table, such that capacity limiting operates correctly. The sidejob_worker also cooperates with a given sidejob_resource_stats server to maintain statistics about a given resource.

By default, a sidejob_worker calculates resource usage based on message queue size. However, the user-specified module can also choose to implement the current_usage/1 and rate/1 callbacks to change how usage is calculated. An example is the sidejob_supervisor module which reports usage as: queue size + num_children.

Function Index

code_change/3
handle_call/3
handle_cast/2
handle_info/2
init/1
reg_name/1
reg_name/2
start_link/6
terminate/2
workers/2

Function Details

code_change/3

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

handle_call/3

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

handle_cast/2

handle_cast(Request, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(X1) -> any()

reg_name/1

reg_name(Id) -> any()

reg_name/2

reg_name(Name, Id) -> any()

start_link/6

start_link(RegName, ResName, Id, ETS, StatsName, Mod) -> any()

terminate/2

terminate(Reason, State) -> any()

workers/2

workers(Name, Count) -> any()


Generated by EDoc