Push class

Object produced by PhoenixChannel.push to encapsulate the message sent and its lifecycle.

Constructors

Push(PhoenixChannel channel, {PhoenixChannelEvent? event, PayloadGetter? payload, Duration? timeout})
Build a Push message from its content and associated channel.

Properties

event → PhoenixChannelEvent?
The event name associated with the pushed message
final
future → Future<PushResponse>
A future that will yield the response to the original message.
no setter
hashCode → int
The hash code for this object.
no setterinherited
payload → PayloadGetter?
A getter function that yields the payload of the pushed message, usually a JSON object.
final
ref → String
The unique identifier of the message used throughout its lifecycle.
no setter
replyEvent → PhoenixChannelEvent
The event name of the expected reply coming from the Phoenix backend.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sent → bool
Indicates whether the push has been sent.
no setter
timeout ↔ Duration?
The expected timeout, after which the push is considered failed.
getter/setter pair

Methods

cancelTimeout() → void
Cancel the scheduled timeout for this push.
cleanUp() → void
clearReceivers() → void
Dispose the set of waiters associated with this push.
hasReceived(String status) → bool
Returns whether the given status was received from the backend as a reply.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onReply(String status, ReceiverCallback callback) → void
Associate a callback to be called if and when a reply with the given status is received.
resend(Duration? newTimeout) → Future<void>
Retry to send the push message.
reset() → void
Reset the scheduled timeout for this push.
send() → Future<void>
Send the push message.
startTimeout() → void
Schedule a timeout to be triggered if no reply occurs within the expected time frame.
toString() → String
A string representation of this object.
inherited
trigger(PushResponse response) → void
Trigger the appropriate waiters and future associated for this push, given the provided response.

Operators

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