Skip to content

Instantly share code, notes, and snippets.

@ashic
Created June 10, 2014 12:02
Show Gist options
  • Save ashic/5d831738732cf50d3b77 to your computer and use it in GitHub Desktop.
Save ashic/5d831738732cf50d3b77 to your computer and use it in GitHub Desktop.
From framework to library...
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