Provides a mechanism to handle signalling errors similar to the JavaScript SDK.
Adds an OnError callback to Signal and Client which propagates errors from the signal stream client to the user. Also changes Signal.onSignalHandle to be started on first use of the signalling client rather than in the constructor to avoid a race condition between the when OnError is registered and when the read loop can call it.
An alternative to the once starting the read loop would have been an explicit Start method which would needed to be called in the Client, however I favoured this as didn't change the Signal interface.
Description
Provides a mechanism to handle signalling errors similar to the JavaScript SDK.
Adds an
OnError
callback toSignal
andClient
which propagates errors from the signal stream client to the user. Also changesSignal.onSignalHandle
to be started on first use of the signalling client rather than in the constructor to avoid a race condition between the whenOnError
is registered and when the read loop can call it.An alternative to the
once
starting the read loop would have been an explicitStart
method which would needed to be called in theClient
, however I favoured this as didn't change theSignal
interface.