Module e2_service

e2 service behavior.

Copyright 2011-2012 Garrett Smith

Behaviours: gen_server.

Authors: Garrett Smith (g@rre.tt).

Description

e2 service behavior.

e2 services are the base process type in e2.

e2 services provide the same functionality as gen_server but with a simplified interface.

For more information see e2 services documentation.

Function Index

call/2Sends a message to a service and waits for a reply.
call/3Sends a message to a service and waits for a reply.
cast/2Sends a message to a service without waiting for a reply.
reply/2Used by service implementations to reply to a message.
start_link/2Starts an e2 service.
start_link/3Starts an e2 service.

Function Details

call/2

call(ServiceRef, Msg) -> any()

Equivalent to call(ServiceRef, Msg, infinity).

Sends a message to a service and waits for a reply.

call/3

call(ServiceRef, Msg, Timeout) -> Reply

Sends a message to a service and waits for a reply.

cast/2

cast(ServiceRef, Msg) -> ok

Sends a message to a service without waiting for a reply.

reply/2

reply(Client, Reply) -> any()

Used by service implementations to reply to a message.

Client is the From argument from the request handle_msg/3 call.

start_link/2

start_link(Module, Args) -> any()

Equivalent to start_link(Module, Args).

Starts an e2 service.

start_link/3

start_link(Module, Args, Options) -> {ok, Pid} | {error, Reason}

Starts an e2 service.

Module is the service callback module.

If init/1 is exported, Args is the argument passed to the function when the service is initialized. If init/1 is not exported, Args is the initial service state.

If registered or {registered, Name} is provided as an option, the service will be registered. If not specified, the registered name defaults to Module.


Generated by EDoc, Jul 7 2014, 18:01:43.