Exemplo n.º 1
0
 /// <summary>
 /// Sends an asynchronous <see cref="Event"/> to a remote machine.
 /// </summary>
 /// <param name="mid">MachineId</param>
 /// <param name="e">Event</param>
 /// <param name="sender">Sender machine</param>
 /// <param name="options">Optional parameters of a send operation.</param>
 internal override void SendEventRemotely(MachineId mid, Event e, AbstractMachine sender, SendOptions options)
 {
     base.NetworkProvider.RemoteSend(mid, e);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Sends an asynchronous <see cref="Event"/> to a machine and
        /// executes the event handler if the machine is available.
        /// </summary>
        /// <param name="mid">MachineId</param>
        /// <param name="e">Event</param>
        /// <param name="sender">Sender machine</param>
        /// <param name="options">Optional parameters of a send operation.</param>
        internal override async Task SendEventAndExecute(MachineId mid, Event e, AbstractMachine sender, SendOptions options)
        {
            var operationGroupId = base.GetNewOperationGroupId(sender, options?.OperationGroupId);

            if (!base.GetTargetMachine(mid, e, sender, operationGroupId, out Machine machine))
            {
                return;
            }

            bool runNewHandler = false;

            this.EnqueueEvent(machine, e, sender, operationGroupId, ref runNewHandler);
            if (runNewHandler)
            {
                await this.RunMachineEventHandlerAsync(machine, null, false);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Sends an asynchronous <see cref="Event"/> to a remote machine.
 /// </summary>
 /// <param name="mid">MachineId</param>
 /// <param name="e">Event</param>
 /// <param name="sender">Sender machine</param>
 /// <param name="options">Optional parameters of a send operation.</param>
 internal abstract void SendEventRemotely(MachineId mid, Event e, AbstractMachine sender, SendOptions options);
Exemplo n.º 4
0
 /// <summary>
 /// Sends an asynchronous <see cref="Event"/> to a machine and
 /// executes the event handler if the machine is available.
 /// </summary>
 /// <param name="mid">MachineId</param>
 /// <param name="e">Event</param>
 /// <param name="sender">Sender machine</param>
 /// <param name="options">Optional parameters of a send operation.</param>
 internal abstract Task SendEventAndExecute(MachineId mid, Event e, AbstractMachine sender, SendOptions options);
Exemplo n.º 5
0
 /// <summary>
 /// Sends an asynchronous <see cref="Event"/> to a remote machine.
 /// </summary>
 /// <param name="target">Target machine id</param>
 /// <param name="e">Event</param>
 /// <param name="options">Optional parameters of a send operation.</param>
 public abstract void RemoteSendEvent(MachineId target, Event e, SendOptions options = null);
Exemplo n.º 6
0
 /// <summary>
 /// Synchronously delivers an <see cref="Event"/> to a machine and
 /// executes the event handler if the machine is available.
 /// </summary>
 /// <param name="target">Target machine id</param>
 /// <param name="e">Event</param>
 /// <param name="options">Optional parameters of a send operation.</param>
 public abstract Task SendEventAndExecute(MachineId target, Event e, SendOptions options = null);