示例#1
0
        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.GrainClient.Initialize("DevTestClientConfiguration.xml");
            Console.WriteLine("Orleans Silo is running.");

            // TODO: once the previous call returns, the silo is up and running.
            //       This is the place your custom logic, for example calling client logic
            //       or initializing an HTTP front end for accepting incoming requests.

            webApiWrapper = new WebApiWrapper();
            if (!webApiWrapper.Run())
            {
                Console.Error.WriteLine("Failed to initialize web api.");
            }
            else
            {
                Console.WriteLine(string.Format("Started web host at: {0}", webApiWrapper.Url));
            }

            Console.WriteLine("Press ENTER to terminate.");
            Console.ReadLine();

            hostDomain.DoCallBack(ShutdownSilo);
        }
示例#2
0
        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.GrainClient.Initialize("DevTestClientConfiguration.xml");
            Console.WriteLine("Orleans Silo is running.");

            // TODO: once the previous call returns, the silo is up and running.
            //       This is the place your custom logic, for example calling client logic
            //       or initializing an HTTP front end for accepting incoming requests.

            webApiWrapper = new WebApiWrapper();
            if (!webApiWrapper.Run())
            {
                Console.Error.WriteLine("Failed to initialize web api.");
            }
            else
            {
                Console.WriteLine(string.Format("Started web host at: {0}", webApiWrapper.Url));
            }

            Console.WriteLine("Press ENTER to terminate.");
            Console.ReadLine();

            hostDomain.DoCallBack(ShutdownSilo);
        }