Example #1
0
        static void Main(string[] args)
        {
            // TODO replace with your connection string
            // const string connectionString = "YOUR_CONNECTION_STRING_HERE";
            mgv_set_log(0);
            unsafe {
                Engine *engine = null; mgv_create_engine("", &engine);
                silo = new SiloHostBuilder()
                       .Configure <ClusterOptions>(options =>
                {
                    options.ClusterId = "orleansdockerwufei";
                    options.ServiceId = "NoThief";
                }).UseLocalhostClustering()
                       //  .UseAzureStorageClustering(options => options.ConnectionString = connectionString)
                       // .ConfigureEndpoints(siloPort: 12345, gatewayPort: 34567)
                       .ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(ValueGrain).Assembly).WithReferences())
                       .ConfigureLogging(builder => builder.SetMinimumLevel(LogLevel.Warning).AddConsole())
                       .Build();

                Task.Run(StartSilo);

                AssemblyLoadContext.Default.Unloading += context =>
                {
                    Task.Run(StopSilo);
                    siloStopped.WaitOne();
                };

                siloStopped.WaitOne();
                mgv_destroy_engine(engine);
            }
        }
Example #2
0
 public extern static unsafe int mgv_destroy_engine(Engine *engine);