示例#1
0
文件: Fsm.api.cs 项目: 0xCM/arrows
 /// <summary>
 /// Runs a machine
 /// </summary>
 /// <param name="context">The machine context</param>
 /// <param name="machine">The specified machine</param>
 /// <typeparam name="E">The event type</typeparam>
 /// <typeparam name="S">The state tyep</typeparam>
 public static Task <Option <FsmStats> > Run <E, S>(Fsm <E, S> machine)
 => Task.Factory.StartNew(() => RunMachine(machine));
示例#2
0
文件: Fsm.api.cs 项目: 0xCM/arrows
 /// <summary>
 /// Creates a default machine observer
 /// </summary>
 /// <param name="fsm">The machine under observation</param>
 /// <param name="trace">Whether to emit trace messages</param>
 /// <typeparam name="E">The event type</typeparam>
 /// <typeparam name="S">The state type</typeparam>
 public static FsmObserver <E, S> DefaultObserver <E, S>(Fsm <E, S> fsm, ObserverTrace?tracing = null)
 => new FsmObserver <E, S>(fsm, tracing);