static void Main(string[] args) { // The Orleans silo environment is initialized in its own app domain in order to more // closely emulate the distributed situation, when the client and the server cannot // pass data via shared memory. AppDomain hostDomain = AppDomain.CreateDomain("OrleansHost", null, new AppDomainSetup { AppDomainInitializer = InitSilo, AppDomainInitializerArguments = args, }); Orleans.OrleansClient.Initialize("DevTestClientConfiguration.xml"); // Observer IDoStuff grain = DoStuffFactory.GetGrain(0); var theObserver = new TheObserver(); var obj = ObserveFactory.CreateObjectReference(theObserver).Result; // factory from IObserve grain.SubscribeForUpdates(obj); // close down Console.WriteLine("Orleans Silo is running.\nPress Enter to terminate..."); Console.ReadLine(); hostDomain.DoCallBack(ShutdownSilo); }
public void TestSimpleDynamicProxy() { IDoStuff actual = new ActualDoStuff(); actual.Foo(); IDoStuff wrapper = Wrapper <IDoStuff> .Wrap <IDoStuff>(actual); wrapper.Foo(); }
public void Test() { IDoStuff actual = new ActualDoStuff(); actual.Foo(); RealProxySample realProxy = new RealProxySample(typeof(IDoStuff), actual); IDoStuff wrapper = (IDoStuff)realProxy.GetTransparentProxy(); wrapper.Foo(); }
public async Task NoActor_Should_Generate_Random_Output(IDoStuff stuffer, bool safe) { _IActor = stuffer; //act _Threads.ForEach(t => t.Start()); _Threads.ForEach(t => t.Join()); //assert var res = await stuffer.GetCount(); if (safe) res.Should().Be(_ThreadCount); else res.Should().NotBe(_ThreadCount); }
public async Task NoActor_Should_Generate_Random_Output(IDoStuff stuffer, bool safe) { _IActor = stuffer; //act _Threads.ForEach(t => t.Start()); _Threads.ForEach(t => t.Join()); //assert var res = await stuffer.GetCount(); if (safe) { res.Should().Be(_ThreadCount); } else { res.Should().NotBe(_ThreadCount); } }
public void Test() { IDoStuff test = (IDoStuff)SecurityProxy.NewInstance(new ActualDoStuff()); test.Foo(); }
private static object[] BuildTestData(IActorFactory factory, IDoStuff stuffer) { return(new object[] { factory.Build(stuffer), true }); }
void UseIDoStuff(IDoStuff incoming) { Console.WriteLine(incoming.SayHelloToBob()); }
static string SayHelloToBob(this IDoStuff other) { return(other.SayHello() + " Bob"); }
private static object[] BuildTestData(IActorFactory factory, IDoStuff stuffer) { return new object[] { factory.Build(stuffer), true }; }
public MyConsumer(IDoStuff myDependency) { this.myDependency = myDependency }
public RequireDi(IDoStuff stuffDoer) { _stuffDoer = stuffDoer; }
public HappyPathTests(IRequireDeps requireDeps, IDoStuff doStuff) { _requireDeps = requireDeps; _doStuff = doStuff; }
public RequireDeps(IDoStuff doStuff) { DoStuff = doStuff; }