Home > @imqueue/rpc > IMQClient

IMQClient class

Class IMQClient - base abstract class for service clients.

Signature:

export declare abstract class IMQClient extends EventEmitter 

Extends: EventEmitter

Constructors

Constructor

Modifiers

Description

(constructor)(options, serviceName, name)

Class constructor

Properties

Property

Modifiers

Type

Description

hostName

readonly

string

id

readonly

number

name

readonly

string

options

readonly

IMQClientOptions

queueName

readonly

string

serviceName

readonly

string

Methods

Method

Modifiers

Description

broadcast(payload)

Broadcasts given payload to all other service clients subscribed. So this is like client-to-clients publishing.

create(name, options)

static

Creates client for a service with the given name

describe(_delay)

Returns service description metadata.

destroy()

Destroys client

remoteCall(args)

protected

Sends call to remote service method

start()

Initializes client work

stop()

Stops client work

subscribe(handler)

Adds subscription to service event channel

unsubscribe()

Destroys subscription channel to service

{Promise}