Beispiel #1
0
        static void Main(string[] args)
        {
            try
            {
                ColoredConsole.WriteTitle("MoviePlaybackSystem: Running Akka.NET demo...");

                // Start ActorSystem
                MoviePlaybackSystemHelper.StartActorSystem(true);
                ActorPaths.LogAllActorPaths();

                // Run interactive session with user inputting commands
                RunUserInteractiveSession();

                // Terminate ActorSystem
                // MoviePlaybackSystemHelper.TerminateActorSystem();

                ColoredConsole.WriteTitle("MoviePlaybackSystem: Quitting Akka.NET demo.");
            }
            catch (Exception ex)
            {
                ColoredConsole.WriteError($"MoviePlaybackSystem: Exception occurred (type: '{ex.GetType().Name}')");
                ColoredConsole.WriteError(ex.Message);
                ColoredConsole.WriteError(ex.StackTrace);
            }
            finally
            {
                // Terminate ActorSystem
                MoviePlaybackSystemHelper.TerminateActorSystem();
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            try
            {
                ColoredConsole.WriteTitle("MoviePlaybackSystem.Remote.PlaybackStatisticsActor: Running Akka.NET demo...");

                // Start ActorSystem
                MoviePlaybackSystemHelper.StartActorSystem(false);
                ActorPaths.LogAllActorPaths();


                // Wait for user input to terminate the application
                ColoredConsole.WriteUserPrompt($"  Press ENTER key to terminate '{MoviePlaybackSystemHelper.ActorSystemName}' ActorSystem...");
                Console.ReadLine();

                // Terminate ActorSystem
                // MoviePlaybackSystemHelper.TerminateActorSystem();

                ColoredConsole.WriteTitle("MoviePlaybackSystem.Remote.PlaybackStatisticsActor: Quitting Akka.NET demo.");
            }
            catch (Exception ex)
            {
                ColoredConsole.WriteError($"MoviePlaybackSystem.Remote.PlaybackStatisticsActor: Exception occurred (type: '{ex.GetType().Name}')");
                ColoredConsole.WriteError(ex.Message);
                ColoredConsole.WriteError(ex.StackTrace);
            }
            finally
            {
                // Terminate ActorSystem
                MoviePlaybackSystemHelper.TerminateActorSystem();
            }
        }