# IMQService class · @imqueue/rpc

Source: https://imqueue.org/api/rpc/latest/rpc.imqservice/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/rpc 3.5.3 — generated reference, not hand-written

Class IMQService Basic abstract service (server-side) implementation

**Signature:**

```typescript
export declare abstract class IMQService 
```

## Constructors


| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(options, name)](https://imqueue.org/api/rpc/latest/rpc.imqservice._constructor_/) |  | Constructs a service. |


## Properties


| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [cache](https://imqueue.org/api/rpc/latest/rpc.imqservice.cache/) | `protected` | [ICache](https://imqueue.org/api/rpc/latest/rpc.icache/) | The cache adapter used by cached methods. |
| [imq](https://imqueue.org/api/rpc/latest/rpc.imqservice.imq/) | `protected` | IMessageQueue | The underlying message queue this service consumes requests from. |
| [logger](https://imqueue.org/api/rpc/latest/rpc.imqservice.logger/) | `protected` | ILogger | The effective logger — `options.logger`, defaulting to `console`. |
| [metricsServer?](https://imqueue.org/api/rpc/latest/rpc.imqservice.metricsserver/) | `protected` | Server<any, any> | _(Optional)_ The metrics HTTP server, present only while [IMQMetricsServerOptions.enabled](https://imqueue.org/api/rpc/latest/rpc.imqmetricsserveroptions.enabled/) is set. |
| [name](https://imqueue.org/api/rpc/latest/rpc.imqservice.name/) |  | string | This service's name, which is also its queue name and the key its description is cached under. |
| [options](https://imqueue.org/api/rpc/latest/rpc.imqservice.options/) |  | [IMQServiceOptions](https://imqueue.org/api/rpc/latest/rpc.imqserviceoptions/) | The effective options for this service: [DEFAULT\_IMQ\_SERVICE\_OPTIONS](https://imqueue.org/api/rpc/latest/rpc.default_imq_service_options/) merged with the values passed to the constructor. |


## Methods


| Method | Modifiers | Description |
| --- | --- | --- |
| [describe()](https://imqueue.org/api/rpc/latest/rpc.imqservice.describe/) |  | Returns this service's description metadata — the exposed method list plus the registered complex types — synchronously. |
| [destroy()](https://imqueue.org/api/rpc/latest/rpc.imqservice.destroy/) |  | Removes this instance's signal handlers, then unsubscribes and destroys the underlying queue. |
| [publish(data)](https://imqueue.org/api/rpc/latest/rpc.imqservice.publish/) |  | Broadcasts data on this service's pub/sub channel, delivering it to every client currently subscribed to this service. |
| [start()](https://imqueue.org/api/rpc/latest/rpc.imqservice.start/) |  | Initializes this instance of service and starts handling request messages. |
| [stop()](https://imqueue.org/api/rpc/latest/rpc.imqservice.stop/) |  | Stops consuming messages from the queue. |

