RealtimeFrame class final

One Pusher-protocol frame, in the shape Thoth actually puts on the wire.

The asymmetry worth knowing: data is itself a JSON string inside the outer JSON object — Thoth's PusherFrame.encode calls jsonEncode on it before encoding the envelope. So a client decodes twice, and this type is the one place that happens.

Constructors

RealtimeFrame(String event, Object? data, {String? channel})
const

Properties

channel → String?
final
data → Object?
final
dataMap → Map<String, Object?>
data as a map, or an empty map when it is anything else.
no setter
event → String
final
hashCode → int
The hash code for this object.
no setterinherited
isProtocol → bool
pusher_internal: frames are the protocol talking about itself; everything else is an application event a subscriber asked for.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

encode() → String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

decode(Object? message) → RealtimeFrame?
Null when message is not a frame this client can read. A malformed message is dropped rather than thrown: one bad payload from a server or a proxy is not a reason to tear down every channel on the socket.