why deepstreamHub? compare us getting started faq
use cases
products
developers
company
blog contact

The entry point for events, such as subscribe(_: listener:), emit(eventName) and provider functionality such as listen(_: listener:).

Methods

emit(_:)

class func emit(_ eventName: String) -> Void
argument type description
eventName String The event name

Sends the event to all subscribed clients without a payload.

Show example...

emit(_:data:)

class func emit(_ eventName: String, data: JsonElement) -> Void
argument type description
eventName String The event name
data JsonElement The data to serialise and send with the event

Sends the event to all subscribed clients with the given payload.

Show example...

subscribe(_:listener:)

class func subscribe(_ eventName: String, listener: EventListener) -> Void
argument type description
eventName String The event name
eventListener EventListener The Event Listener

Subscribes to eventName and notifies the listener via EventListener whenever it occurs locally or remotely.

Show example...

unsubscribe(_:listener:)

class func unsubscribe(_ eventName: String, listener: EventListener) -> Void
argument type description
eventName String The event name
eventListener EventListener The Event Listener

Unsubscribes from an event that was previously registered with subscribe(). This stops a client from receiving the event.

Show example...

listen(_:listener:)opensource / enterprise

class func listen(_ pattern: String, listener: ListenListener) -> Void
argument type description
pattern String The pattern to match events which subscription status you want to be informed of
listener ListenListener The Listen Listener

Registers the client as a listener for event subscriptions made by other clients. This is useful to create active data providers - processes that only send events if clients are actually interested in them. You can find more about listening in the events tutorial.

Show example...

unlisten(_:)opensource / enterprise

class func unlisten(_ pattern: String) -> Void
argument type description
pattern String The pattern that has been previously listened to

Remove the listener added via listen(_:listener:). This will remove the provider as the active provider and allow another provider to take its place.

Show example...