PhoenixChannel class
Bi-directional and isolated communication channel shared between differents clients through a common Phoenix server.
Constructors
-
PhoenixChannel.fromSocket(PhoenixSocket socket, {required String topic, Map<
String, dynamic> ? parameters, Duration? timeout}) - Build a PhoenixChannel from a PhoenixSocket.
Properties
- canPush → bool
-
Whether the channel can send messages.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- joinRef → String
-
Unique identifier of the 'join' push message.
no setter
- leavePush → Push?
-
no setter
- loggerName → String
-
The name of the logger associated to this channel.
no setter
-
messages
→ Stream<
Message> -
Stream of all messages coming through this channel from the backend.
no setter
-
parameters
→ Map<
String, dynamic> -
Parameters passed to the backend at join time.
final
-
pushBuffer
→ List<
Push> -
A list of push to be sent out once the channel is joined.
final
- reference → String
-
This channel's unique numeric reference.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- socket → PhoenixSocket
-
The PhoenixSocket through which this channel is established.
final
- state → PhoenixChannelState
-
State of the channel.
no setter
- topic → String
-
The name of the topic to which this channel will bind.
final
Methods
-
close(
) → void - Close this channel.
-
join(
[Duration? newTimeout]) → Push - Join this channel using the associated PhoenixSocket.
-
leave(
{Duration? timeout}) → Push - Leave this channel.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onPushReply(
PhoenixChannelEvent replyEvent) → Future< Message> - Returns a future that will complete (or throw) when the provided reply arrives (or throws).
-
push(
String eventName, Map< String, dynamic> payload, [Duration? newTimeout]) → Push - Push a message to the Phoenix server.
-
pushEvent(
PhoenixChannelEvent event, Map< String, dynamic> payload, [Duration? newTimeout]) → Push - Push a message with a valid PhoenixChannelEvent name.
-
toString(
) → String -
A string representation of this object.
inherited
-
trigger(
Message message) → void - Trigger the reception of a message.
-
triggerError(
PhoenixException error) → void - Trigger an error on this channel.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited