Module riak_api_pb_registrar

Encapsulates the Protocol Buffers service registration and deregistration as a gen_server process.

Behaviours: gen_server.

Description

Encapsulates the Protocol Buffers service registration and deregistration as a gen_server process. This is used to serialize write access to the registration table so that it is less prone to race-conditions.

Function Index

code_change/3
deregister/1Deregisters a range of message codes registered to named services.
handle_call/3
handle_cast/2
handle_info/2
init/1
lookup/1Looks up the registration of a given message code.
register/1Registers a range of message codes to named services.
services/0Lists registered service modules.
start_link/0Starts the registrar server.
swap/3Atomically swap currently registered module with NewModule.
terminate/2

Function Details

code_change/3

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

deregister/1

deregister(Registrations::[riak_api_pb_service:registration()]) -> ok | {error, Reason::term()}

Deregisters a range of message codes registered to named services.

handle_call/3

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

handle_cast/2

handle_cast(Msg, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(X1) -> any()

lookup/1

lookup(Code::non_neg_integer()) -> {ok, module()} | error

Looks up the registration of a given message code.

register/1

register(Registrations::[riak_api_pb_service:registration()]) -> ok | {error, Reason::term()}

Registers a range of message codes to named services.

services/0

services() -> [module()]

Lists registered service modules.

start_link/0

start_link() -> {ok, pid()}

Starts the registrar server

swap/3

swap(NewModule::module(), MinCode::pos_integer(), MaxCode::pos_integer()) -> ok | {error, Reason::term()}

Atomically swap currently registered module with NewModule.

terminate/2

terminate(Reason, State) -> any()


Generated by EDoc