Class: Service

ProtoBuf.Builder. Service

Barebone of all runtime services.

new Service(rpcImpl)

Constructs a new runtime Service.

Parameters:
Name Type Argument Description
rpcImpl function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=)) <optional>

RPC implementation receiving the method name and the message

Throws:
If the service cannot be created
Type
Error

Members

rpcImpl :function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))

Service implementation.

Methods

<virtual, static> [Method](rpcImpl, req, callback)

Asynchronously performs an RPC call using the given RPC implementation.

Parameters:
Name Type Description
rpcImpl function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))

RPC implementation

req ProtoBuf.Builder.Message

Request

callback function(Error, (ProtoBuf.Builder.Message | ByteBuffer | Buffer | string)=)

Callback receiving the error if any and the response either as a pre-parsed message or as its raw bytes

<virtual> [Method](req, callback)

Asynchronously performs an RPC call using the instance's RPC implementation.

Parameters:
Name Type Description
req ProtoBuf.Builder.Message

Request

callback function(Error, (ProtoBuf.Builder.Message | ByteBuffer | Buffer | string)=)

Callback receiving the error if any and the response either as a pre-parsed message or as its raw bytes