# Class: Service

## ProtoBuf .Builder. Service

Barebone of all runtime services.

## Constructor

#### new Service(rpcImplopt)

Constructs a new runtime Service.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`rpcImpl` | function | <optional> | RPC implementation receiving the method name and the message

Source:
  - protobuf.js, line 4005

##### Throws:

If the service cannot be created

Type
  Error

### Members

#### (static) $options :Object.<string, *>

Service options.

##### Type:

- Object.<string, *>

Source:
  - protobuf.js, line 4108

#### (static, non-null) $type :ProtoBuf.Reflect.Service

Reflection type.

##### Type:

- ProtoBuf.Reflect.Service

Source:
  - protobuf.js, line 4124

#### $options :Object.<string, *>

Service options.

##### Type:

- Object.<string, *>

Source:
  - protobuf.js, line 4116

#### (non-null) $type :ProtoBuf.Reflect.Service

Reflection type.

##### Type:

- ProtoBuf.Reflect.Service

Source:
  - protobuf.js, line 4132

#### (non-null) rpcImpl :function

Service implementation.

##### Type:

- function

Source:
  - protobuf.js, line 4016

### Methods

#### (abstract, static) [Method](rpcImplnon-null, req, callback)

Asynchronously performs an RPC call using the given RPC implementation.

##### Parameters:

Name | Type | Description
--- | --- | ---
`rpcImpl` | function | RPC implementation
`req` | ProtoBuf.Builder.Message | Request
`callback` | function | Callback receiving the error if any and the response either as a pre-parsed message or as its raw bytes

Source:
  - protobuf.js, line 4036

#### (abstract) [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 | Callback receiving the error if any and the response either as a pre-parsed message or as its raw bytes

Source:
  - protobuf.js, line 4047