SseConnection class
A bi-directional SSE connection between server and browser.
Constructors
- SseConnection(Sink _sink, {Duration? keepAlive})
-
Creates an SseConnection for the supplied
_sink
.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInKeepAlivePeriod → bool
-
Whether this connection is currently in the KeepAlive timeout period.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sink
→ StreamSink<
String> -
The message added to the sink has to be JSON encodable.
no setteroverride
-
stream
→ Stream<
String> -
Stream of messages sent from the server to this client.
no setteroverride
Methods
-
cast<
S> () → StreamChannel< S> -
Returns a copy of this with the generic type coerced to
S
.inherited -
changeSink(
StreamSink< String> change(StreamSink<String> )) → StreamChannel<String> -
Returns a copy of this with sink replaced by
change
's return value.inherited -
changeStream(
Stream< String> change(Stream<String> )) → StreamChannel<String> -
Returns a copy of this with stream replaced by
change
's return value.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pipe(
StreamChannel< String> other) → void -
Connects this to
other
, so that any values emitted by either are sent directly to the other.inherited -
shutdown(
) → void - Immediately close the connection, ignoring any keepAlive period.
-
toString(
) → String -
A string representation of this object.
inherited
-
transform<
S> (StreamChannelTransformer< S, String> transformer) → StreamChannel<S> -
Transforms this using
transformer
.inherited -
transformSink(
StreamSinkTransformer< String, String> transformer) → StreamChannel<String> -
Transforms only the sink component of this using
transformer
.inherited -
transformStream(
StreamTransformer< String, String> transformer) → StreamChannel<String> -
Transforms only the stream component of this using
transformer
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited