IMQService class

Class IMQService Basic abstract service (server-side) implementation

Signature:

export declare abstract class IMQService 

Constructors

Constructor

Modifiers

Description

(constructor)(options, name)

Constructs a service.

Properties

Property

Modifiers

Type

Description

cache

protected

ICache

The cache adapter used by cached methods.

imq

protected

IMessageQueue

The underlying message queue this service consumes requests from.

logger

protected

ILogger

The effective logger — options.logger, defaulting to console.

metricsServer?

protected

Server<any, any>

(Optional) The metrics HTTP server, present only while IMQMetricsServerOptions.enabled is set.

name

string

This service's name, which is also its queue name and the key its description is cached under.

options

IMQServiceOptions

The effective options for this service: DEFAULT_IMQ_SERVICE_OPTIONS merged with the values passed to the constructor.

Methods

Method

Modifiers

Description

describe()

Returns this service's description metadata — the exposed method list plus the registered complex types — synchronously.

destroy()

Removes this instance's signal handlers, then unsubscribes and destroys the underlying queue.

publish(data)

Broadcasts data on this service's pub/sub channel, delivering it to every client currently subscribed to this service.

start()

Initializes this instance of service and starts handling request messages.

stop()

Stops consuming messages from the queue.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.