TWSStream Class Reference
Inherits from | NSObject |
---|---|
Declared in | TWSStream.h |
Overview
Interface for Sync Pub-sub messaging primitive.
Message Stream is a Sync primitive for real-time pub-sub messaging. Stream Messages are not persisted, they exist only in transit, and will be dropped if (due to congestion or network anomalies) they cannot be delivered promptly.
– sid
An immutable system-assigned identifier of this Message Stream.
- (nonnull NSString *)sid
Return Value
A string containing Message Stream SID.
Discussion
An immutable system-assigned identifier of this Message Stream.
Declared In
TWSStream.h
– uniqueName
An optional unique name for this stream, assigned at creation time.
- (nullable NSString *)uniqueName
Return Value
The unique name.
Discussion
An optional unique name for this stream, assigned at creation time.
Declared In
TWSStream.h
– publishMessageWithData:completion:
Publish a new message to this message stream.
- (void)publishMessageWithData:(nonnull TWSData *)data completion:(nullable TWSStreamMessageCompletion)completion
Parameters
data |
Contains the payload of the dispatched message. Maximum size in serialized JSON: 4KB. |
---|---|
completion |
Completion block that will specify the result of the operation and the unique message identifier if the operation is successful. |
Discussion
Publish a new message to this message stream.
Declared In
TWSStream.h
– setTtl:completion:
Update the stream’s time to live.
- (void)setTtl:(TWSDuration)ttl completion:(nullable TWSCompletion)completion
Parameters
ttl |
The new time to live for this stream in seconds from now or TWSDurationInfinity to indicate no expiry. |
---|---|
completion |
Completion block that will specify the result of the operation. |
Discussion
Update the stream’s time to live.
Declared In
TWSStream.h
– removeStreamWithCompletion:
Remove the stream from the system, deleting it.
- (void)removeStreamWithCompletion:(nullable TWSCompletion)completion
Parameters
completion |
Completion block that will specify the result of the operation. |
---|
Discussion
Remove the stream from the system, deleting it.
Declared In
TWSStream.h