Пример #1
0
 /// <summary>
 /// Returns a fair nondeterministic boolean choice, that can be
 /// controlled during analysis or testing.
 /// </summary>
 internal override bool GetFairNondeterministicBooleanChoice(AsyncMachine machine, string uniqueId)
 {
     return(this.GetNondeterministicBooleanChoice(machine, 2));
 }
Пример #2
0
        /// <summary>
        /// Sends an asynchronous <see cref="Event"/> to a machine. Returns immediately if the target machine was
        /// already running. Otherwise blocks until the machine handles the event and reaches quiescense.
        /// </summary>
        internal override async Task <bool> SendEventAndExecuteAsync(MachineId target, Event e, AsyncMachine sender,
                                                                     Guid opGroupId, SendOptions options)
        {
            EnqueueStatus enqueueStatus = this.EnqueueEvent(target, e, sender, opGroupId, out Machine targetMachine);

            if (enqueueStatus is EnqueueStatus.EventHandlerNotRunning)
            {
                await this.RunMachineEventHandlerAsync(targetMachine, null, false);

                return(true);
            }

            return(enqueueStatus is EnqueueStatus.Dropped);
        }