feat: expose mapped raw and uns data through grpc adapters
This commit is contained in:
+9
-2
@@ -467,10 +467,17 @@ public sealed class DataConnectionDeploymentLease : IDataConnection, IDisposable
|
||||
public async Task<IDataSubscription> SubscribeAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Check(DataOperations.Subscribe); var stream = await _inner.SubscribeAsync(cancellationToken).ConfigureAwait(false);
|
||||
try { Check(DataOperations.Subscribe); return new ScopedSubscription(this, stream); }
|
||||
try { Check(DataOperations.Subscribe); return stream is IDataSubscriptionProvenance provenance
|
||||
? new ProvenancedScopedSubscription(this, stream, provenance.Serving)
|
||||
: new ScopedSubscription(this, stream); }
|
||||
catch { await stream.DisposeAsync().ConfigureAwait(false); throw; }
|
||||
}
|
||||
private sealed class ScopedSubscription(DataConnectionDeploymentLease owner, IDataSubscription inner) : IDataSubscription
|
||||
private sealed class ProvenancedScopedSubscription(DataConnectionDeploymentLease owner, IDataSubscription inner, ServingIdentity serving)
|
||||
: ScopedSubscription(owner, inner), IDataSubscriptionProvenance
|
||||
{
|
||||
public ServingIdentity Serving { get; } = serving;
|
||||
}
|
||||
private class ScopedSubscription(DataConnectionDeploymentLease owner, IDataSubscription inner) : IDataSubscription
|
||||
{
|
||||
public Task SendAsync(DataSubscriptionCommand command, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user