Skip to content

PURISTA API / Modules / @purista/mqttbridge / TopicRouter

Class: TopicRouter

@purista/mqttbridge.TopicRouter

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new TopicRouter(logger?): TopicRouter

Parameters

NameType
logger?Logger

Returns

TopicRouter

Defined in

mqttbridge/src/topic/TopicRouter.ts:13

Properties

counter

counter: number = 1

Defined in

mqttbridge/src/topic/TopicRouter.ts:11


logger

logger: Logger

Defined in

mqttbridge/src/topic/TopicRouter.ts:9


routes

routes: Map<number, { fn: IncomingMessageFunction ; topic: string }>

Defined in

mqttbridge/src/topic/TopicRouter.ts:8

Methods

add

add(topic, fn): number

Parameters

NameType
topicstring
fnIncomingMessageFunction

Returns

number

Defined in

mqttbridge/src/topic/TopicRouter.ts:18


match

match(topic, id?): IncomingMessageFunction[]

Parameters

NameType
topicstring
id?number

Returns

IncomingMessageFunction[]

Defined in

mqttbridge/src/topic/TopicRouter.ts:32


remove

remove(topic): void

Parameters

NameType
topicstring | number

Returns

void

Defined in

mqttbridge/src/topic/TopicRouter.ts:26