/// <summary> /// Executes the index creation against each of the shards Async. /// </summary> public override Task ExecuteIndexAsync(AbstractIndexCreationTask indexCreationTask) { 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.ExecuteAsync(commands, Conventions) .ContinueWith(t => tcs.SetResult(true)); } catch (Exception e) { tcs.SetException(e); } return tcs.Task; }); }
public virtual Task ExecuteIndexAsync(AbstractIndexCreationTask indexCreationTask) { return indexCreationTask.ExecuteAsync(AsyncDatabaseCommands, Conventions); }