コード例 #1
0
 public async Task <StreamMetadataResult> GetStreamMetadata(
     string streamId,
     CancellationToken cancellationToken = new CancellationToken())
 => await Trace(
     nameof(GetStreamMetadata),
     streamId,
     () => _streamStore.GetStreamMetadata(streamId, cancellationToken));
コード例 #2
0
        public async Task <StreamMetadataResult> GetStreamMetadata(
            string streamId,
            CancellationToken cancellationToken = new CancellationToken())
        {
            var span = _spanSource.Begin("stream-store." + nameof(GetStreamMetadata), ServiceName, streamId, TypeName);

            try
            {
                return(await _streamStore
                       .GetStreamMetadata(
                           streamId,
                           cancellationToken));
            }
            catch (Exception ex)
            {
                span?.SetError(ex);
                throw;
            }
            finally
            {
                span?.Dispose();
            }
        }