/// <summary> /// Synchronouses the request with retry. /// </summary> /// <typeparam name="T">The result type of the task.</typeparam> /// <param name="oracle">The oracle to use.</param> /// <param name="impl">The task implementation.</param> /// <returns>The result of the task.</returns> internal static T SynchronousRequestWithRetry <T>(ShouldRetry oracle, Func <Action <T>, TaskSequence> impl) { return(TaskImplHelper.ExecuteImpl <T>((setResult) => RequestWithRetryImpl <T>(oracle, impl, setResult))); }
/// <summary> /// Checks whether the table exists. /// </summary> /// <param name="tableName">The table name.</param> /// <returns><c>true</c> if table exists; otherwise, <c>false</c>.</returns> public bool DoesTableExist(string tableName) { return(TaskImplHelper.ExecuteImpl <bool>((setResult) => this.DoesTableExistImpl(tableName, setResult))); }
/// <summary> /// Creates the table if it does not already exist. /// </summary> /// <param name="tableName">The table name.</param> /// <returns><c>true</c> if table was created; otherwise, <c>false</c>.</returns> public bool CreateTableIfNotExist(string tableName) { return(TaskImplHelper.ExecuteImpl <bool>((setResult) => this.CreateTableIfNotExistImpl(tableName, setResult))); }
/// <summary> /// Copies the specified amount of data from internal buffers to the buffer and advances the position. /// </summary> /// <param name="buffer">An array of bytes. When this method returns, the buffer contains the specified byte array with the values /// between offset and (offset + count - 1) replaced by the bytes read from the current source.</param> /// <param name="offset">The zero-based byte offset in buffer at which to begin storing the data read from the current stream.</param> /// <param name="count">The maximum number of bytes to be read from the current stream.</param> /// <returns> The total number of bytes read into the buffer. This can be less than the number of bytes requested /// if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. /// </returns> /// <exception cref="System.ArgumentException">The sum of offset and count is larger than the buffer length.</exception> /// <exception cref="System.ArgumentNullException">The buffer parameter is null.</exception> /// <exception cref="System.ArgumentOutOfRangeException">The offset or count parameters are negative.</exception> /// <exception cref="System.IO.IOException">An I/O error occurs.</exception> public override int Read(byte[] buffer, int offset, int count) { return(TaskImplHelper.ExecuteImpl <int>((result) => { return this.ReadImplWrapper(buffer, offset, count, result); })); }
/// <summary> /// Commits the blob on the server. /// </summary> public override void Commit() { TaskImplHelper.ExecuteImpl(this.CommitImpl); }
/// <summary> /// Causes any buffered data to be written to the remote storage. If the blob is not using blocks, the blob is fully committed. /// </summary> /// <exception cref="System.IO.IOException">An I/O error occurs while writing to storage.</exception> public override void Flush() { this.CheckWriteState(); TaskImplHelper.ExecuteImpl(this.FlushInternal); }