Esempio n. 1
0
 /// <summary>
 /// Asynchronously determines database sizes
 /// </summary>
 /// <param name="db">Database instance to inspect</param>
 /// <returns>Awaitable Task of inspect operation</returns>
 public static Task GetInfoAsync(this DbInstance db)
 {
     return(TaskEx.Run(() => db.GetInfo()));
 }
Esempio n. 2
0
 /// <summary>
 /// Asynchronously compacts specified database instance
 /// </summary>
 /// <param name="db">Database instance to compact</param>
 /// <returns>Awaitable Task of compact operation</returns>
 public static Task CompactAsync(this DbInstance db)
 {
     return(TaskEx.Run(() => db.Compact()));
 }
Esempio n. 3
0
 /// <summary>
 /// Asynchronously purges specified database instance
 /// </summary>
 /// <param name="db">Database instance to purge</param>
 /// <returns>Awaitable Task of purge operation</returns>
 public static Task PurgeAsync(this DbInstance db)
 {
     return(TaskEx.Run(() => db.Purge()));
 }
Esempio n. 4
0
 /// <summary>
 /// Asynchronously executes write actions inside write transaction
 /// </summary>
 /// <param name="db">Database instance to write to</param>
 /// <param name="writes">Write operations to perform</param>
 /// <returns>Awaitable Task of write operations</returns>
 public static Task BulkWriteAsync(this DbInstance db, Action writes)
 {
     return(TaskEx.Run(() => db.BulkWrite(writes)));
 }
Esempio n. 5
0
 /// <summary>
 /// Asynchronously executes read actions inside read transaction
 /// </summary>
 /// <param name="db">Database instance to read from</param>
 /// <param name="reads">Read operations to perform</param>
 /// <returns>Awaitable Task of read operations</returns>
 public static Task BulkReadAsync(this DbInstance db, Action reads)
 {
     return(TaskEx.Run(() => db.BulkRead(reads)));
 }
Esempio n. 6
0
 /// <summary>
 /// Asynchronously initializes database instance
 /// </summary>
 /// <param name="db">Database instance to initialize</param>
 /// <returns>Awaitable Task of initialize operation</returns>
 public static Task InitializeAsync(this DbInstance db)
 {
     return(TaskEx.Run(() => db.Initialize()));
 }