Exemplo n.º 1
0
        public async Task QueueAction(
            KernelCommandInvocation action)
        {
            var command = new AnonymousKernelCommand(action);

            await HandlingKernel.SendAsync(command);
        }
Exemplo n.º 2
0
 public AnonymousKernelCommand(
     KernelCommandInvocation handler,
     string targetKernelName = null)
     : base(targetKernelName)
 {
     Handler = handler;
 }
Exemplo n.º 3
0
 public KernelInvocationContext(
     KernelCommandInvocation invocation,
     Action <IKernelEvent> publishEvent)
 {
     _invocation   = invocation;
     _publishEvent = publishEvent;
 }
 private KernelInvocationContext(
     IKernelCommand command,
     KernelInvocationContext parentContext = null)
 {
     _parentContext = parentContext;
     Command        = command;
     _invocation    = command.InvokeAsync;
 }
Exemplo n.º 5
0
 public AnonymousKernelCommand(
     KernelCommandInvocation handler,
     string targetKernelName = null,
     KernelCommand parent    = null)
     : base(targetKernelName, parent)
 {
     Handler = handler;
     ShouldPublishCompletionEvent = false;
 }
Exemplo n.º 6
0
        public void OnExecute(KernelCommandInvocation invocation)
        {
            if (invocation == null)
            {
                throw new ArgumentNullException(nameof(invocation));
            }

            _invocations.Add(new KernelInvocationContext(
                                 invocation,
                                 _publishEvent));
        }
Exemplo n.º 7
0
 public AnonymousKernelCommand(KernelCommandInvocation handler)
 {
     Handler = handler;
 }