Esempio n. 1
0
        public static FluentConfig LogLevel(this FluentConfig self, LogLevel logLevel)
        {
            self.AsInstanceOf <FluentConfigInternals>()
            .AppendLine(string.Format("akka.loglevel = {0}", logLevel.StringFor()));

            return(self);
        }
Esempio n. 2
0
 public static FluentConfig LogRemote(this FluentConfig self, LogLevel lifecycleEvents = LogLevel.DebugLevel, bool receivedMessages = false, bool sentMessages = false)
 {
     return(self
            .LogRemoteLifecycleEvents(lifecycleEvents)
            .LogReceivedMessages(receivedMessages)
            .LogSentMessages(sentMessages));
 }
Esempio n. 3
0
        public static FluentConfig DefaultDispatcher(this FluentConfig self, Type dispatcherType, int throughput = 100, TimeSpan?throughputDeadlineTimeout = null)
        {
            var type = dispatcherType.AssemblyQualifiedName;

            self.ConfigureDispatcher(type, throughput, throughputDeadlineTimeout);
            return(self);
        }
Esempio n. 4
0
        private static FluentConfig LogRemoteLifecycleEvents(this FluentConfig self, LogLevel logLevel)
        {
            ((FluentConfigInternals)self).AppendLine(string.Format("akka.remote.log-remote-lifecycle-events = {0}",
                                                                   logLevel.StringFor()));

            return(self);
        }
Esempio n. 5
0
 private static FluentConfig DebugLifecycle(this FluentConfig self, bool on)
 {
     if (on)
     {
         self.AsInstanceOf <FluentConfigInternals>().AppendLine("akka.actor.debug.lifecycle = on");
     }
     return(self);
 }
Esempio n. 6
0
 private static FluentConfig DebugAutoReceive(this FluentConfig self, bool on)
 {
     if (on)
     {
         self.AsInstanceOf <FluentConfigInternals>().AppendLine("akka.actor.debug.autoreceive = on");
     }
     return(self);
 }
Esempio n. 7
0
        /*
         * log-config-on-start = on
         * stdout-loglevel = DEBUG
         * loglevel = ERROR
         * actor {
         * provider = ""Akka.Remote.RemoteActorRefProvider, Akka.Remote""
         *
         * debug {
         * receive = on
         * autoreceive = on
         * lifecycle = on
         * event-stream = on
         * unhandled = on
         * }
         */

        public static FluentConfig LogConfigOnStart(this FluentConfig self, bool on)
        {
            if (on)
            {
                ((FluentConfigInternals)self).AppendLine("akka.log-config-on-start = on");
            }
            return(self);
        }
Esempio n. 8
0
 public static FluentConfig DebugUnhandled(this FluentConfig self, bool on)
 {
     if (on)
     {
         self.AsInstanceOf <FluentConfigInternals>().AppendLine("akka.actor.debug.unhandled = on");
     }
     return(self);
 }
Esempio n. 9
0
 private static FluentConfig DebugEventStream(this FluentConfig self, bool on)
 {
     if (on)
     {
         self.AsInstanceOf <FluentConfigInternals>().AppendLine("akka.actor.debug.event-stream = on");
     }
     return(self);
 }
Esempio n. 10
0
 private static FluentConfig LogSentMessages(this FluentConfig self, bool on)
 {
     if (on)
     {
         self.AsInstanceOf <FluentConfigInternals>().AppendLine("akka.remote.log-sent-messages = on");
     }
     return(self);
 }
Esempio n. 11
0
 private static FluentConfig LogReceivedMessages(this FluentConfig self, bool on)
 {
     if (on)
     {
         ((FluentConfigInternals)self).AppendLine("akka.remote.log-received-messages = on");
     }
     return(self);
 }
Esempio n. 12
0
 public static FluentConfig LogLocal(this FluentConfig self, bool receive = false, bool autoReceive = false, bool lifecycle = false, bool eventStream = false, bool unhandled = false)
 {
     return(self.DebugReceive(receive)
            .DebugAutoReceive(autoReceive)
            .DebugLifecycle(lifecycle)
            .DebugEventStream(eventStream)
            .DebugUnhandled(unhandled));
 }
Esempio n. 13
0
        public static FluentConfig DefaultDispatcher(this FluentConfig self, DispatcherType dispatcherType,
                                                     int throughput = 100, TimeSpan?throughputDeadlineTimeout = null)
        {
            string type = dispatcherType.GetName();

            self.ConfigureDispatcher(type, throughput, throughputDeadlineTimeout);

            return(self);
        }
Esempio n. 14
0
 private static void ConfigureDispatcher(this FluentConfig self, string type, int throughput,
                                         TimeSpan?throughputDeadlineTimeout)
 {
     self.AsInstanceOf <FluentConfigInternals>()
     .AppendLine(string.Format("akka.actor.default-dispatcher.type = '{0}'", type));
     self.AsInstanceOf <FluentConfigInternals>()
     .AppendLine(string.Format("akka.actor.default-dispatcher.throughput = {0}", throughput));
     self.AsInstanceOf <FluentConfigInternals>()
     .AppendLine(string.Format("akka.actor.default-dispatcher.throughput-deadline-time = {0}ms",
                               throughputDeadlineTimeout.GetValueOrDefault(TimeSpan.FromSeconds(0)).TotalMilliseconds));
 }
Esempio n. 15
0
        public static FluentConfig StartRemotingOn(this FluentConfig self, string hostname, int port)
        {
            string remoteConfig = @"
akka.actor.provider = ""Akka.Remote.RemoteActorRefProvider, Akka.Remote""
akka.remote.helios.tcp.transport-class = ""Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote""
akka.remote.helios.tcp.applied-adapters = []
akka.remote.helios.tcp.transport-protocol = tcp
akka.remote.helios.tcp.port = {0}
akka.remote.helios.tcp.hostname = 0.0.0.0 #listens on ALL ips for this machine
akka.remote.helios.tcp.public-hostname = {1} #but only accepts connections on localhost (usually 127.0.0.1)
";

            self.AsInstanceOf <FluentConfigInternals>().AppendLine(string.Format(remoteConfig, port, hostname));

            return(self);
        }
Esempio n. 16
0
 /*
  * remote {
  *      log-received-messages = on
  *      log-sent-messages = on
  #log-remote-lifecycle-events = on
  *
  #this is the new upcoming remoting support, which enables multiple transports
  * helios.tcp {
  *  transport-class = ""Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote""
  *          applied-adapters = []
  *          transport-protocol = tcp
  *          port = 8081
  *          hostname = 0.0.0.0 #listens on ALL ips for this machine
  *  public-hostname = localhost #but only accepts connections on localhost (usually 127.0.0.1)
  * }
  * log-remote-lifecycle-events = INFO
  * }*/
 public static FluentConfig StartRemotingOn(this FluentConfig self, string hostname)
 {
     return(self.StartRemotingOn(hostname, 0));
 }