Class GraphQLSubscription
public sealed class GraphQLSubscription : IAsyncEnumerable<GraphQLResponse>, IAsyncDisposable
- Inheritance
-
GraphQLSubscription
- Implements
- Inherited Members
- Extension Methods
Properties
IsCompleted
public bool IsCompleted { get; }
Property Value
Transport
public GraphQLSubscriptionTransport Transport { get; }
Property Value
Methods
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous dispose operation.
ExpectNextAsync<TShape>(TShape, CancellationToken)
public Task<GraphQLResponse> ExpectNextAsync<TShape>(TShape expectedShape, CancellationToken cancellationToken = default)
Parameters
expectedShapeTShapecancellationTokenCancellationToken
Returns
Type Parameters
TShape
GetAsyncEnumerator(CancellationToken)
Iterates the subscription's events. The enumerator disposes the previous event as it advances, so
await foreach without a per-element using does not leak a document and response per
event; the event currently yielded - and the last one - stay yours to use (and dispose), like an
event from NextAsync(CancellationToken).
public IAsyncEnumerator<GraphQLResponse> GetAsyncEnumerator(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
NextAsync(CancellationToken)
public Task<GraphQLResponse?> NextAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken