Channel
Rxmq channel class
Constructor Summary
| Public Constructor | ||
| public |
constructor(plugins: Array): void Represents a new Rxmq channel. |
|
Member Summary
| Private Members | ||
| private |
[prop]: * Hide from esdoc |
|
| private |
Channel bus |
|
| private |
channelStream: Observable Permanent channel bus stream as Observable |
|
| private |
Instances of subjects |
|
| private |
Internal set of utilities |
|
Method Summary
| Public Methods | ||
| public |
Get an Observable for specific set of topics |
|
| public |
registerPlugin(plugin: Object): void Channel plugin registration |
|
| public |
Do a request that will be replied into returned AsyncSubject Alias for '.request()' that uses single object as params |
|
| public |
subject(name: String): EndlessSubject Returns EndlessSubject representing given topic |
|
Public Constructors
Private Members
Public Methods
public observe(name: String): Observable source
Get an Observable for specific set of topics
Params:
| Name | Type | Attribute | Description |
| name | String | Topic name / pattern |
Return:
| Observable | Observable for given set of topics |
Example:
const channel = rxmq.channel('test');
channel.observe('test.topic')
.subscribe((res) => { // default Observable subscription
// handle results
});
public registerPlugin(plugin: Object): void source
Channel plugin registration
Params:
| Name | Type | Attribute | Description |
| plugin | Object | Plugin object to apply |
Return:
| void |
public request(options: Object): AsyncSubject source
Do a request that will be replied into returned AsyncSubject Alias for '.request()' that uses single object as params
Return:
| AsyncSubject | AsyncSubject that will dispatch the response |
Example:
const channel = rxmq.channel('test');
channel.requestTo({
topic: 'test.topic',
data: 'test data',
}).subscribe((response) => { // default Observable subscription
// handle response
});
public subject(name: String): EndlessSubject source
Returns EndlessSubject representing given topic
Params:
| Name | Type | Attribute | Description |
| name | String | Topic name |
Example:
const channel = rxmq.channel('test');
const subject = channel.subject('test.topic');
