Exemplo n.º 1
0
 internal static void OnPreShutdown(ShutdownCancellationToken cancel)
 {
     preShutdownSubj.OnNext(cancel);
     if (!cancel.Cancelled)
     {
         preShutdownSubj.OnCompleted();
     }
 }
Exemplo n.º 2
0
        public static Unit StopSystem(SystemName system)
        {
            lock (sync)
            {
                if (context == system)
                {
                    context = default(SystemName);
                }

                if (defaultSystem == system)
                {
                    defaultSystem = default(SystemName);
                }

                ActorSystem asystem = null;
                var         token   = new ShutdownCancellationToken(system);
                try
                {
                    Process.OnPreShutdown(token);
                }
                finally
                {
                    if (!token.Cancelled)
                    {
                        try
                        {
                            systems.TryGetValue(system, out asystem);
                            if (asystem != null)
                            {
                                asystem.Dispose();
                            }
                        }
                        finally
                        {
                            systems.TryRemove(system, out asystem);
                            Process.OnShutdown(system);
                        }
                    }
                }
                return(unit);
            }
        }
Exemplo n.º 3
0
        public static Unit StopSystem(SystemName system)
        {
            lock (sync)
            {
                if(context == system)
                {
                    context = default(SystemName);
                }

                if(defaultSystem == system)
                {
                    defaultSystem = default(SystemName);
                }

                ActorSystem asystem = null;
                var token = new ShutdownCancellationToken(system);
                try
                {
                    Process.OnPreShutdown(token);
                }
                finally
                {
                    if (!token.Cancelled)
                    {
                        try
                        {
                            systems.TryGetValue(system, out asystem);
                            if (asystem != null)
                            {
                                asystem.Dispose();
                            }
                        }
                        finally
                        {
                            systems.TryRemove(system, out asystem);
                            Process.OnShutdown(system);
                        }
                    }
                }
                return unit;
            }
        }