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

A singleton that allows for centralized access to a created DeepstreamClient. Alternatively, clients can be initialised directly.

Currently this only contains a single deepstream client.

Methods

getInstance()

func getInstance() -> DeepstreamFactory
Show example...

getClient()

class func getClient() -> DeepstreamClient

Returns the last client that was created. This is useful for most applications that only require a single connection. The first time a client is connected however it has to be via getClient(_:) or getClient(_:options:).

Show example...

getClient(_:)

class func getClient(_ url: String) throws -> DeepstreamClient
argument type description
url String The url to connect to, also the key used to retrieve in

Returns a client that was previous created via the same url using this method or getClient(_:options:).

If a client hasn't been created yet, it creates it first and stores it for future reference.

Show example...

getClient(_:options:)

class func getClient(_ url: String, options: JsonElement) throws -> DeepstreamClient
argument type description
url String The url to connect to, also the key used to retrieve in
options JsonElement The options to use within the deepstream client

Returns a client that was previous created via the same url using this method or getClient(url,options).

If a client hasn't been created yet, it creates it first and stores it for future reference.