public async Task SendAsync(IMaintenanceOperation operation, CancellationToken token = default(CancellationToken)) { using (GetContext(out JsonOperationContext context)) { var command = operation.GetCommand(_requestExecutor.Conventions, context); await RequestExecutor.ExecuteAsync(command, context, token : token).ConfigureAwait(false); } }
public async Task <Operation> SendAsync(IMaintenanceOperation <OperationIdResult> operation, CancellationToken token = default(CancellationToken)) { using (GetContext(out JsonOperationContext context)) { var command = operation.GetCommand(RequestExecutor.Conventions, context); await RequestExecutor.ExecuteAsync(command, context, token : token).ConfigureAwait(false); return(new Operation(RequestExecutor, () => _store.Changes(_databaseName), RequestExecutor.Conventions, command.Result.OperationId)); } }
public async Task <Operation <TResult> > SendAsync <TResult>(IMaintenanceOperation <OperationIdResult <TResult> > operation, CancellationToken token = default) { using (GetContext(out JsonOperationContext context)) { var command = operation.GetCommand(RequestExecutor.Conventions, context); await RequestExecutor.ExecuteAsync(command, context, sessionInfo : null, token : token).ConfigureAwait(false); return(new Operation <TResult>(RequestExecutor, () => _store.Changes(_databaseName), RequestExecutor.Conventions, command.Result.Result, command.Result.OperationId, command.SelectedNodeTag ?? command.Result.OperationNodeTag)); } }
public async Task <TResult> SendAsync <TResult>(IMaintenanceOperation <TResult> operation, CancellationToken token = default) { using (GetContext(out JsonOperationContext context)) { var command = operation.GetCommand(_requestExecutor.Conventions, context); await RequestExecutor.ExecuteAsync(command, context, sessionInfo : null, token : token).ConfigureAwait(false); return(command.Result); } }
public async Task <TResult> SendAsync <TResult>(IMaintenanceOperation <TResult> operation, CancellationToken token = default(CancellationToken)) { JsonOperationContext context; using (RequestExecutor.ContextPool.AllocateOperationContext(out context)) { var command = operation.GetCommand(_requestExecutor.Conventions, context); await RequestExecutor.ExecuteAsync(command, context, token).ConfigureAwait(false); return(command.Result); } }
private static async Task <Operation> SendAsync(IDocumentStore store, IMaintenanceOperation <OperationIdResult <StartBackupOperationResult> > operation, CancellationToken token = default) { var re = store.GetRequestExecutor(); using (re.ContextPool.AllocateOperationContext(out var context)) { var command = operation.GetCommand(re.Conventions, context); await re.ExecuteAsync(command, context, null, token).ConfigureAwait(false); var selectedNodeTag = command.SelectedNodeTag ?? command.Result.Result.ResponsibleNode; return(new Operation(re, () => store.Changes(store.Database, selectedNodeTag), re.Conventions, command.Result.OperationId, selectedNodeTag)); } }
public Operation Send(IMaintenanceOperation <OperationIdResult> operation) { return(AsyncHelpers.RunSync(() => SendAsync(operation))); }
public TResult Send <TResult>(IMaintenanceOperation <TResult> operation) { return(AsyncHelpers.RunSync(() => SendAsync(operation))); }
public void Send(IMaintenanceOperation operation) { AsyncHelpers.RunSync(() => SendAsync(operation)); }