PhoenixRawSocket class
Main class to use when wishing to establish a persistent connection with a Phoenix backend using WebSockets.
- Inheritance
-
- Object
- PhoenixSocket
- PhoenixRawSocket
Constructors
- PhoenixRawSocket(String endpoint, {PhoenixSocketOptions? socketOptions})
- Creates an instance of PhoenixRawSocket
Properties
-
channels
↔ Map<
String, PhoenixChannel> -
Map of topic names to
PhoenixChannel
instances being maintained and tracked by the socket.getter/setter pairinherited -
closeStream
→ Stream<
PhoenixSocketCloseEvent> -
Stream of
PhoenixSocketCloseEvent
being produced whenever the connection closes.no setterinherited - defaultTimeout → Duration
-
Default duration for a connection timeout.
no setterinherited
- endpoint → String
-
The string URL of the remote Phoenix server.
no setterinherited
-
errorStream
→ Stream<
PhoenixSocketErrorEvent> -
Stream of
PhoenixSocketErrorEvent
being produced in the lifetime of the PhoenixSocket.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- isConnected → bool
-
Whether the underlying socket is connected of not.
no setterinherited
-
messageStream
→ Stream<
Message> -
Stream of all
Message
instances received.no setterinherited - mountPoint → Uri
-
The Uri containing all the parameters and options for the
remote connection to occue.
no setterinherited
- nextRef → String
-
A property yielding unique message reference ids,
monotonically increasing.
no setterinherited
-
openStream
→ Stream<
PhoenixSocketOpenEvent> -
Stream of
PhoenixSocketOpenEvent
being produced whenever the connection is open.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addChannel(
{required String topic, Map< String, dynamic> ? parameters, Duration? timeout}) → PhoenixChannel -
topic
is the name of the channel you wish to joinparameters
are any options parameters you wish to sendinherited -
close(
[int? code, String? reason, dynamic reconnect = false]) → void -
Close the underlying connection supporting the socket.
inherited
-
connect(
) → Future< PhoenixSocket?> -
Attempts to make a WebSocket connection to the Phoenix backend.
inherited
-
dispose(
) → void -
Dispose of the socket.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onSocketDataCallback(
dynamic message) → void -
Processing incoming data from the socket
override
-
removeChannel(
PhoenixChannel channel) → void -
Stop managing and tracking a channel on this phoenix
socket.
inherited
-
sendMessage(
Message message) → Future< Message> -
Send a channel on the socket.
inherited
-
streamForTopic(
String topic) → Stream< Message> -
A stream yielding
Message
instances for a given topic.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
waitForMessage(
Message message) → Future< Message> -
Wait for an expected message to arrive.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited