public ActiveObject() { join = Join.Create(); join.Initialize(out ProcessMessage); join.Initialize(out Start); join.When(Start).Do(delegate { Thread.CurrentThread.IsBackground = true; while (!done) ProcessMessage(); }); Start(); }
static object Initialize(Join j, int i) { switch (i % 8) { case 0 : { Asynchronous.Channel c; j.Initialize(out c); return c; } case 1 : { Asynchronous.Channel<string> c; j.Initialize(out c); return c; } case 2 : { Synchronous<string>.Channel<string> c; j.Initialize(out c); return c; } case 3 : { Synchronous<string>.Channel c; j.Initialize(out c); return c; } case 4 : { Synchronous.Channel<string> c; j.Initialize(out c); return c; } case 5 : { Synchronous.Channel c; j.Initialize(out c); return c; } case 6: { Asynchronous.Channel[] c; j.Initialize(out c, 1); return c; } case 7: { Asynchronous.Channel<string>[] c; j.Initialize(out c, 1); return c; } default : Debug.Assert(false); return null; } }