Exemplo n.º 1
0
 private ActorMaterializerSettings Copy(
     int?initialInputBufferSize = null,
     int?maxInputBufferSize     = null,
     string dispatcher          = null,
     Decider supervisionDecider = null,
     StreamSubscriptionTimeoutSettings subscriptionTimeoutSettings = null,
     StreamRefSettings streamRefSettings = null,
     bool?isDebugLogging     = null,
     int?outputBurstLimit    = null,
     bool?isFuzzingMode      = null,
     bool?isAutoFusing       = null,
     int?maxFixedBufferSize  = null,
     int?syncProcessingLimit = null)
 {
     return(new ActorMaterializerSettings(
                initialInputBufferSize ?? InitialInputBufferSize,
                maxInputBufferSize ?? MaxInputBufferSize,
                dispatcher ?? Dispatcher,
                supervisionDecider ?? SupervisionDecider,
                subscriptionTimeoutSettings ?? SubscriptionTimeoutSettings,
                streamRefSettings ?? StreamRefSettings,
                isDebugLogging ?? IsDebugLogging,
                outputBurstLimit ?? OutputBurstLimit,
                isFuzzingMode ?? IsFuzzingMode,
                isAutoFusing ?? IsAutoFusing,
                maxFixedBufferSize ?? MaxFixedBufferSize,
                syncProcessingLimit ?? SyncProcessingLimit));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Leaked publishers and subscribers are cleaned up when they are not used within a given
 /// deadline, configured by <see cref="StreamSubscriptionTimeoutSettings"/>.
 /// </summary>
 /// <param name="settings">TBD</param>
 /// <returns>TBD</returns>
 public ActorMaterializerSettings WithSubscriptionTimeoutSettings(StreamSubscriptionTimeoutSettings settings)
 {
     if (Equals(settings, SubscriptionTimeoutSettings))
     {
         return(this);
     }
     return(Copy(subscriptionTimeoutSettings: settings));
 }
Exemplo n.º 3
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="settings">TBD</param>
        /// <returns>TBD</returns>
        public ActorMaterializerSettings WithSubscriptionTimeoutSettings(StreamSubscriptionTimeoutSettings settings)
        {
            if (Equals(settings, SubscriptionTimeoutSettings))
            {
                return(this);
            }

            return(new ActorMaterializerSettings(InitialInputBufferSize, MaxInputBufferSize, Dispatcher, SupervisionDecider, settings, IsDebugLogging, OutputBurstLimit, IsFuzzingMode, IsAutoFusing, MaxFixedBufferSize, SyncProcessingLimit));
        }
Exemplo n.º 4
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="initialInputBufferSize">TBD</param>
 /// <param name="maxInputBufferSize">TBD</param>
 /// <param name="dispatcher">TBD</param>
 /// <param name="supervisionDecider">TBD</param>
 /// <param name="subscriptionTimeoutSettings">TBD</param>
 /// <param name="isDebugLogging">TBD</param>
 /// <param name="outputBurstLimit">TBD</param>
 /// <param name="isFuzzingMode">TBD</param>
 /// <param name="isAutoFusing">TBD</param>
 /// <param name="maxFixedBufferSize">TBD</param>
 /// <param name="syncProcessingLimit">TBD</param>
 public ActorMaterializerSettings(int initialInputBufferSize, int maxInputBufferSize, string dispatcher, Decider supervisionDecider, StreamSubscriptionTimeoutSettings subscriptionTimeoutSettings, bool isDebugLogging, int outputBurstLimit, bool isFuzzingMode, bool isAutoFusing, int maxFixedBufferSize, int syncProcessingLimit = DefaultlMaxFixedbufferSize)
 {
     InitialInputBufferSize      = initialInputBufferSize;
     MaxInputBufferSize          = maxInputBufferSize;
     Dispatcher                  = dispatcher;
     SupervisionDecider          = supervisionDecider;
     SubscriptionTimeoutSettings = subscriptionTimeoutSettings;
     IsDebugLogging              = isDebugLogging;
     OutputBurstLimit            = outputBurstLimit;
     IsFuzzingMode               = isFuzzingMode;
     IsAutoFusing                = isAutoFusing;
     MaxFixedBufferSize          = maxFixedBufferSize;
     SyncProcessingLimit         = syncProcessingLimit;
 }
Exemplo n.º 5
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="initialInputBufferSize">TBD</param>
        /// <param name="maxInputBufferSize">TBD</param>
        /// <param name="dispatcher">TBD</param>
        /// <param name="supervisionDecider">TBD</param>
        /// <param name="subscriptionTimeoutSettings">TBD</param>
        /// <param name="streamRefSettings">TBD</param>
        /// <param name="isDebugLogging">TBD</param>
        /// <param name="outputBurstLimit">TBD</param>
        /// <param name="isFuzzingMode">TBD</param>
        /// <param name="isAutoFusing">TBD</param>
        /// <param name="maxFixedBufferSize">TBD</param>
        /// <param name="blockingIoDispatcher">TBD</param>
        /// <param name="syncProcessingLimit">TBD</param>
        public ActorMaterializerSettings(
            int initialInputBufferSize,
            int maxInputBufferSize,
            string dispatcher,
            Decider supervisionDecider,
            StreamSubscriptionTimeoutSettings subscriptionTimeoutSettings,
            StreamRefSettings streamRefSettings,
            bool isDebugLogging,
            int outputBurstLimit,
            bool isFuzzingMode,
            bool isAutoFusing,
            int maxFixedBufferSize,
            int syncProcessingLimit = DefaultMaxFixedBufferSize)
        {
            if (initialInputBufferSize <= 0)
            {
                throw new ArgumentException($"{nameof(initialInputBufferSize)} must be > 0", nameof(initialInputBufferSize));
            }
            if (syncProcessingLimit <= 0)
            {
                throw new ArgumentException($"{nameof(syncProcessingLimit)} must be > 0", nameof(syncProcessingLimit));
            }

            if (maxInputBufferSize <= 0)
            {
                throw new ArgumentException($"{nameof(maxInputBufferSize)} must be > 0", nameof(maxInputBufferSize));
            }
            if ((maxInputBufferSize & (maxInputBufferSize - 1)) != 0)
            {
                throw new ArgumentException($"{nameof(maxInputBufferSize)} must be a power of two", nameof(maxInputBufferSize));
            }

            if (initialInputBufferSize > maxInputBufferSize)
            {
                throw new ArgumentException($"initialInputBufferSize({initialInputBufferSize}) must be <= maxInputBufferSize({maxInputBufferSize})");
            }

            InitialInputBufferSize      = initialInputBufferSize;
            MaxInputBufferSize          = maxInputBufferSize;
            Dispatcher                  = dispatcher;
            SupervisionDecider          = supervisionDecider;
            SubscriptionTimeoutSettings = subscriptionTimeoutSettings;
            IsDebugLogging              = isDebugLogging;
            OutputBurstLimit            = outputBurstLimit;
            IsFuzzingMode               = isFuzzingMode;
            IsAutoFusing                = isAutoFusing;
            MaxFixedBufferSize          = maxFixedBufferSize;
            SyncProcessingLimit         = syncProcessingLimit;
            StreamRefSettings           = streamRefSettings;
        }
Exemplo n.º 6
0
 private static ActorMaterializerSettings Create(Config config)
 {
     return(new ActorMaterializerSettings(
                initialInputBufferSize: config.GetInt("initial-input-buffer-size", 4),
                maxInputBufferSize: config.GetInt("max-input-buffer-size", 16),
                dispatcher: config.GetString("dispatcher", string.Empty),
                supervisionDecider: Deciders.StoppingDecider,
                subscriptionTimeoutSettings: StreamSubscriptionTimeoutSettings.Create(config),
                isDebugLogging: config.GetBoolean("debug-logging"),
                outputBurstLimit: config.GetInt("output-burst-limit", 1000),
                isFuzzingMode: config.GetBoolean("debug.fuzzing-mode"),
                isAutoFusing: config.GetBoolean("auto-fusing", true),
                maxFixedBufferSize: config.GetInt("max-fixed-buffer-size", 1000000000),
                syncProcessingLimit: config.GetInt("sync-processing-limit", 1000)));
 }
Exemplo n.º 7
0
        // NOTE: Make sure that this class can handle empty Config
        private static ActorMaterializerSettings Create(Config config)
        {
            // No need to check for Config.IsEmpty because this function expects empty Config.
            if (config == null)
            {
                throw ConfigurationException.NullOrEmptyConfig <ActorMaterializerSettings>();
            }

            return(new ActorMaterializerSettings(
                       initialInputBufferSize: config.GetInt("initial-input-buffer-size", 4),
                       maxInputBufferSize: config.GetInt("max-input-buffer-size", 16),
                       dispatcher: config.GetString("dispatcher", string.Empty),
                       supervisionDecider: Deciders.StoppingDecider,
                       subscriptionTimeoutSettings: StreamSubscriptionTimeoutSettings.Create(config),
                       isDebugLogging: config.GetBoolean("debug-logging", false),
                       outputBurstLimit: config.GetInt("output-burst-limit", 1000),
                       isFuzzingMode: config.GetBoolean("debug.fuzzing-mode", false),
                       isAutoFusing: config.GetBoolean("auto-fusing", true),
                       maxFixedBufferSize: config.GetInt("max-fixed-buffer-size", 1000000000),
                       syncProcessingLimit: config.GetInt("sync-processing-limit", 1000),
                       streamRefSettings: StreamRefSettings.Create(config.GetConfig("stream-ref"))));
        }