Created
June 10, 2014 12:02
-
-
Save ashic/5d831738732cf50d3b77 to your computer and use it in GitHub Desktop.
From framework to library...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VigilEngine | |
{ | |
private readonly Beam _beam; | |
public VigilEngine(Beam beam) | |
{ | |
_beam = beam; | |
Console.WriteLine("Creating engine. {0}", Thread.CurrentThread.ManagedThreadId); | |
while (true) | |
{ | |
var msg = beam.Receive(); | |
start(msg); | |
} | |
} | |
private void start(BeamMessage message) | |
{ | |
if ((string) message.Message == "start") | |
{ | |
var sup = _beam.Spawn("vigilsupervisor", null); | |
_beam.Send(sup, "start"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment