Home > @loopback/context > ContextSubscriptionManager
ContextSubscriptionManager class
Manager for context observer subscriptions
Signature:
export declare class ContextSubscriptionManager extends EventEmitter
Extends: EventEmitter
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
|
Constructs a new instance of the |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
|
|
Set<ContextEventObserver> | undefined |
A list of registered context observers. The Set will be created when the first observer is added. | |
|
|
(Optional) A listener to watch parent context events | ||
|
|
Methods
| Method | Modifiers | Description |
|---|---|---|
|
Close the context: clear observers, stop notifications, and remove event listeners from its parent context. | ||
|
Check if an observer is subscribed to this context | ||
|
|
Publish an event to the registered observers. Please note the notification is queued and performed asynchronously so that we allow fluent APIs such as | |
|
Add a context event observer to the context | ||
|
Remove the context event observer from the context | ||
|
Wait until observers are notified for all of currently pending notification events. This method is for test only to perform assertions after observers are notified for relevant events. |