static void Main(string[] args) { var rt = new MessagingRuntime(); var cook = rt.Spawn(new Cook()); rt.Spawn(cook, () => EggFryer(2)); rt.Spawn(cook, () => BaconFryer(3)); rt.Spawn(new ToastMaker(cook, 2)); rt.Wait(); }
public override void Invoke(MessagingRuntime rt, Mailbox mbox) { rt.Spawn(Self, () => Toaster(count)); mbox.Receive(); Console.WriteLine("Putting butter on the toast"); Console.WriteLine("Putting jam on the toast"); rt.Send(to, new BreakfastItem <Toast>(toast)); }