Home Reference Source
import Rxmq from 'rxmq/src/rxmq.js'
public class | source

Rxmq

Rxmq message bus class

Constructor Summary

Public Constructor
public

Represents a new Rxmq message bus.

Member Summary

Private Members
private

[prop]: *

Hide from esdoc

private

Holds channel plugins definitions

private

Holds channels definitions

Method Summary

Public Methods
public

Returns a channel for given name

public

registerChannelPlugin(plugin: Object): void

Register new Channel plugin

public

registerPlugin(plugin: Object): void

Register new Rxmq plugin

Public Constructors

public constructor() source

Represents a new Rxmq message bus. Normally you'd just use a signleton returned by default, but it's also possible to create a new instance of Rxmq should you need it.

Example:

import {Rxmq} from 'rxmq';
const myRxmq = new Rxmq();

Private Members

private [prop]: * source

Hide from esdoc

private channelPlugins: Object source

Holds channel plugins definitions

private channels: Object source

Holds channels definitions

Public Methods

public channel(name: String): Channel source

Returns a channel for given name

Params:

NameTypeAttributeDescription
name String

Channel name

Return:

Channel

Channel object

Example:

const testChannel = rxmq.channel('test');

public registerChannelPlugin(plugin: Object): void source

Register new Channel plugin

Params:

NameTypeAttributeDescription
plugin Object

Channel plugin object

Return:

void

Example:

import myChannelPlugin from 'my-channel-plugin';
rxmq.registerChannelPlugin(myChannelPlugin);

public registerPlugin(plugin: Object): void source

Register new Rxmq plugin

Params:

NameTypeAttributeDescription
plugin Object

Plugin object

Return:

void

Example:

import myPlugin from 'my-plugin';
rxmq.registerPlugin(myPlugin);