Ejemplo n.º 1
0
        async Task SetAsync(EventHorizonKey eventHorizon, ulong offset)
        {
            var o = Offset.From(eventHorizon, offset, _config.BasePartitionKey);

            try
            {
                var result = await _config.Client.UpsertDocumentAsync(_config.OffsetsUri, o, new RequestOptions { PartitionKey = new PartitionKey(_config.BasePartitionKey) });

                _logger.Debug(ResponseMetadata.FromOffset("Setting Geodesics Offset", result)?.ToString());
            }
            catch (DocumentClientException ex)
            {
                throw new EventStorePersistenceError("Error", ex);
            }
        }
        async Task SetAsync(EventProcessorId eventProcessorId, CommittedEventVersion committedEventVersion)
        {
            var offset = Offset.From(eventProcessorId, committedEventVersion, _config.BasePartitionKey);

            try
            {
                var result = await _config.Client.UpsertDocumentAsync(_config.OffsetsUri, offset, new RequestOptions { PartitionKey = new PartitionKey(_config.BasePartitionKey) });

                _logger.Debug(ResponseMetadata.FromOffset("Setting Offset", result)?.ToString());
            }
            catch (DocumentClientException ex)
            {
                throw new EventStorePersistenceError("Error", ex);
            }
        }