TWSStreamDelegate Protocol Reference

Conforms to NSObject
Declared in TWSStream.h

Overview

The delegate delivers events that are fired by the Message Stream as a result of asynchronous completion of locally invoked methods, or any remote operations triggered by other actors on the same Stream.

– onStreamOpened:

Called when the message stream is opened or created.

- (void)onStreamOpened:(nonnull TWSStream *)stream

Parameters

stream

The reference to the message stream.

Discussion

Called when the message stream is opened or created.

Declared In

TWSStream.h

– onStream:removedWithEventContext:

Called when the stream is removed as a result of a local operation.

- (void)onStream:(nonnull TWSStream *)stream removedWithEventContext:(nonnull TWSEventContext *)eventContext

Parameters

stream

The reference to the message stream.

eventContext

Context for this event.

Discussion

Called when the stream is removed as a result of a local operation.

Declared In

TWSStream.h

– onStream:messagePublished:eventContext:

Called when the stream message is published, either as a result of a local operation or remotely.

- (void)onStream:(nonnull TWSStream *)stream messagePublished:(nonnull TWSStreamMessage *)message eventContext:(nonnull TWSEventContext *)eventContext

Parameters

stream

The reference to the message stream.

message

The published message.

eventContext

Context for this event.

Discussion

Called when the stream message is published, either as a result of a local operation or remotely.

Declared In

TWSStream.h

– onStreamRemoved:eventContext:

Called when the stream is removed.

- (void)onStreamRemoved:(nonnull TWSStream *)stream eventContext:(nonnull TWSEventContext *)eventContext

Parameters

stream

The reference to the removed message stream.

eventContext

Context for this event.

Discussion

Called when the stream is removed.

Declared In

TWSStream.h

– onStream:errorOccurred:

Called when an error occurs.

- (void)onStream:(nonnull TWSStream *)stream errorOccurred:(nonnull TWSError *)error

Parameters

stream

The reference to the message stream.

error

The error encounted. The error object will include the error status code, extended error code and and error message.

Discussion

Called when an error occurs.

This event is fired whenever any Message Stream errors occur, typically resulting from a locally requested operation. Notable error conditions include stream being non-existent, inaccessible or message publications rate being too high.

Declared In

TWSStream.h