SubscriptionStream

A handle to an open subscriptions/listen stream. The stream runs on a background task, dispatching the leading notifications/subscriptions/acknowledged and every subsequent opted-in change notification to the client's onNotification (and onProgress). Call cancel() (alias close()) to stop listening; the background task then closes the connection and terminates.

final
class SubscriptionStream {}

Constructors

this
this(shared(bool)* cancelled, void delegate() @(safe) nothrow onCancel)

Construct a handle wrapping a shared cancellation flag. Created by a ClientTransport when it opens the listen stream. onCancel, when supplied, is invoked exactly once on the first cancel() (after the flag is set) so a single-channel transport can emit its stdio notifications/cancelled for the listen request id.

Members

Functions

cancel
void cancel()

Request that the stream stop and its background task terminate. Idempotent: the transport-supplied onCancel (if any) runs only on the first call.

cancelled
bool cancelled()

Whether cancel()/close() has been called.

close
void close()

Alias for cancel().