Пример #1
0
 private static void SolutionAction(ISolutionStrategy strategy, ZmqSocket socket, BucketActionStep step, IFormatter formatter = null)
 {
     SendUpdateMessage(strategy, step.ActionTaken == BucketActions.Init ? ProblemUpdateType.Initial : ProblemUpdateType.Action, socket, step as IFrameable);
 }
Пример #2
0
 /// <summary>
 /// Signal Client(s) of an action step that was performed during the work
 /// </summary>
 /// <param name="step"><see cref="WaterBucket.Domain.BucketActionStep"/> executed during work solving a problem</param>
 /// <param name="yieldOnAction">Yield the current Thread after sending the action step message to the Client(s)</param>
 /// <remarks>The yieldOnAction parameter is designed to artifically add concurrency to messages being received and sent to the Client(s)</remarks>
 /// <seealso cref="System.Threading.Thread.Yield"/>
 protected void ProblemActionStep(BucketActionStep step, bool yieldOnAction = false)
 {
     if (BroadcastAll)
     {
         Clients.All.actionStep(step);
     }
     else
     {
         Clients.Caller.actionStep(step);
     }
     if (yieldOnAction)
         Thread.Yield();
 }
Пример #3
0
 public static BucketActionStep GetFromBytes(byte[] data, ref int offset, Encoding textEncoding = null)
 {
     BucketActionStep bs = new BucketActionStep();
     offset = bs.FromBytes(data, offset, textEncoding);
     return bs;
 }