public async Task Project(Envelope message, CancellationToken cancellationToken = default(CancellationToken)) { if (_suspended) { return; } await Extensions.HandleException(() => _inner.Project(message, cancellationToken), Suspend); }
public async Task Project(Envelope message, CancellationToken cancellationToken = default(CancellationToken)) { await _inner.Project(message, cancellationToken).ConfigureAwait(false); _currentSize++; if (_currentSize >= _maxBatchSize) { await Commit(cancellationToken).ConfigureAwait(false); } }
public async Task Project(Envelope message, CancellationToken cancellationToken = default(CancellationToken)) { var checkpoint = message.Checkpoint; if (_lastCheckpoint == null || checkpoint > _lastCheckpoint) { await _inner.Project(message, cancellationToken).ConfigureAwait(false); _lastCheckpoint = checkpoint; _notifyCheckpoint?.Invoke(AllStreamPosition.FromNullableInt64(_lastCheckpoint)); } }