/// <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); }
/// <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); } }
/// <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);
/// <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);
/// <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);
/// <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);