Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Using ISignalBus

ISignalBus is available for servers that send multiple notifications to multiple clients based on a single event. This interface allows many individual signals to be grouped. For instance, a server might provide signal notifications when a flip phone is opened or closed. Each client interested in knowing when the flip phone is opened or closed would provide a separate ISignal interface to the server. The server can use the ISignalBus interface to manage this group of signals, which are all notified of a single common event.

Active vs. inactive

Servers may also optionally request to receive notification when an ISignalBus "becomes active" -- that is, when the number of enabled signals on an ISignalBus transitions from zero to non-zero. When the ISignalBus is inactive (no enabled signals on the bus), the server may go into an idle state where the entire server goes dormant. If no one is listening on the ISignalBus, there may be no need for the server to remain active. In such cases, the server can provide its own ISignal to the ISignalBus using ISignalBus_OnEnable(). This guarantees that the server will be notified when an active listener shows up on the ISignalBus. The server would generally use this notification to transition from the idle state into its active state.

The following figure shows the sequence diagram for a signal bus:

Signal Factory