TestSseClient class final
An SSE client to use for testing.
Changes may be made to this class without following semantic conventions.
- Implemented types
Constructors
-
TestSseClient.internal({required UnmodifiableMapView<
String, String> headers, required Duration connectTimeout, required Duration readTimeout, required String? body, required SseHttpMethod httpMethod, Stream<Event> ? sourceStream})
Properties
- body → String?
-
final
- connectTimeout → Duration
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ UnmodifiableMapView<
String, String> -
final
- httpMethod → SseHttpMethod
-
final
- readTimeout → Duration
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
Event> -
Subscribe to this stream to receive events and sometimes errors.
subscribe triggers the connection, so expect network delay initially.
no setteroverride
Methods
-
close(
) → Future -
Closes the SSEClient and tears down connections and resources. Do not use the
SSEClient after close is called, behavior is undefined at that point.
override
-
emitError(
{Object? error}) → void - Emit an error event.
-
emitEvent(
Event event) → void - Emit an event on the stream. Has no effect if the client has been closed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
restart(
) → void -
Request that the SSEClient drops the current connection and then
establishes a new connection respecting delay/backoff as if this was
an error condition with the connection.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited