WriteContent() public method

public WriteContent ( string name, byte content, long expectedStreamVersion, int retry ) : System.Threading.Tasks.Task
name string
content byte
expectedStreamVersion long
retry int
return System.Threading.Tasks.Task
        public async Task Append(string streamName, byte[] data, long expectedStreamVersion = -1)
        {
            int retry = 0;

            try
            {
                var azurehelper = new AzureBlobAppenderHelper(this.storage, this.container, this.options);
                await azurehelper.WriteContent(streamName, data, expectedStreamVersion);
            }
            catch (ConcurrentIndexException)
            {
                while (retry < retrypolicy.Length)
                {
                    await Task.Delay(retrypolicy[retry]);
                    await this.Append(streamName, data, expectedStreamVersion);
                    retry++;
                }

                throw;
            }
            catch (StorageException ex)
            {
                var requestInformation = ex.RequestInformation;
                var extended = requestInformation.ExtendedErrorInformation;
                throw;
            }
        }
Beispiel #2
0
        public async Task Append(string streamName, byte[] data, long expectedStreamVersion = -1)
        {
            int retry = 0;

            try
            {
                var azurehelper = new AzureBlobAppenderHelper(this.storage, this.container, this.options);
                await azurehelper.WriteContent(streamName, data, expectedStreamVersion);
            }
            catch (ConcurrentIndexException)
            {
                while (retry < retrypolicy.Length)
                {
                    await Task.Delay(retrypolicy[retry]);

                    await this.Append(streamName, data, expectedStreamVersion);

                    retry++;
                }

                throw;
            }
            catch (StorageException ex)
            {
                var requestInformation = ex.RequestInformation;
                var extended           = requestInformation.ExtendedErrorInformation;
                throw;
            }
        }