BridgeOperationStream class

Namespace Runic.Application.Views · Runic.Application 0.7.0-preview.5

public sealed class BridgeOperationStream

A bounded, cursor-addressed sequence of encoded operation results.

Constructors

BridgeOperationStream

public BridgeOperationStream(int maximumItems = 128, int maximumBytes = 65536)

Creates a bounded stream. BridgeOperationStream.TryPublish returns false once it overflows.

Fields

DefaultMaximumBytes

public const int DefaultMaximumBytes = 65536

The default per-stream byte bound. A window reserves each running stream's bound against a 256 KiB running-stream budget, so by default four streams can run at once.

Properties

Failure

public BridgeOperationDeliveryFailure? Failure { get; }

The terminal delivery failure, if the stream failed.

Methods

Complete

public void Complete()

Marks the stream as complete; later values are rejected.

Fail

public void Fail(BridgeOperationDeliveryFailure failure)

Stops accepting values and exposes a delivery failure to stream readers.

ReadAfter

public BridgeOperationStreamRead ReadAfter(long cursor)

Reads the retained values whose sequence is greater than cursor.

TryPublish

public bool TryPublish(string encodedJson)

Appends an encoded value.

Returns

false when the stream is complete, failed or has overflowed.