예제 #1
0
		public override Task SideBySideExecuteIndexAsync(AbstractIndexCreationTask indexCreationTask, Etag minimumEtagBeforeReplace = null, DateTime? replaceTimeUtc = null)
		{
			var list = ShardStrategy.Shards.Values.Select(x => x.AsyncDatabaseCommands).ToList();
			return ShardStrategy.ShardAccessStrategy.ApplyAsync(list, new ShardRequestData(), (commands, i) =>
			{
				var tcs = new TaskCompletionSource<bool>();

				try
				{
					indexCreationTask.SideBySideExecuteAsync(commands, Conventions, minimumEtagBeforeReplace, replaceTimeUtc)
									 .ContinueWith(t => tcs.SetResult(true));
				}
				catch (Exception e)
				{
					tcs.SetException(e);
				}

				return tcs.Task;
			});
		}
예제 #2
0
		/// <summary>
		/// Executes the index creation in side-by-side mode.
		/// </summary>
		public virtual Task SideBySideExecuteIndexAsync(AbstractIndexCreationTask indexCreationTask, Etag minimumEtagBeforeReplace = null, DateTime? replaceTimeUtc = null)
		{
			return indexCreationTask.SideBySideExecuteAsync(AsyncDatabaseCommands, Conventions, minimumEtagBeforeReplace, replaceTimeUtc);
		}