public async Task SendAsync( IKernelCommand command, KernelInvocationContext context) { EnsureMiddlewarePipelineIsInitialized(); try { await _pipeline(command, context, (_, __) => Task.CompletedTask); } catch (Exception exception) { context.OnNext( new CommandFailed( exception, command)); } }