예제 #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));
 }
예제 #2
0
 public ActorMaterializerSettings WithStreamRefSettings(StreamRefSettings settings)
 {
     if (settings == null)
     {
         throw new ArgumentNullException(nameof(settings));
     }
     if (ReferenceEquals(settings, this.StreamRefSettings))
     {
         return(this);
     }
     return(Copy(streamRefSettings: settings));
 }
예제 #3
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;
        }
예제 #4
0
 public ActorMaterializerSettings WithStreamRefSettings(StreamRefSettings settings)
 {
     if (settings == null)
     {
         throw new ArgumentNullException(nameof(settings));
     }
     if (ReferenceEquals(settings, this.StreamRefSettings))
     {
         return(this);
     }
     return(new ActorMaterializerSettings(InitialInputBufferSize, MaxInputBufferSize, Dispatcher,
                                          SupervisionDecider, SubscriptionTimeoutSettings, settings, IsDebugLogging, OutputBurstLimit,
                                          IsFuzzingMode, IsAutoFusing, MaxFixedBufferSize, SyncProcessingLimit));
 }
예제 #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="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 = DefaultlMaxFixedbufferSize)
 {
     InitialInputBufferSize      = initialInputBufferSize;
     MaxInputBufferSize          = maxInputBufferSize;
     Dispatcher                  = dispatcher;
     SupervisionDecider          = supervisionDecider;
     SubscriptionTimeoutSettings = subscriptionTimeoutSettings;
     IsDebugLogging              = isDebugLogging;
     OutputBurstLimit            = outputBurstLimit;
     IsFuzzingMode               = isFuzzingMode;
     IsAutoFusing                = isAutoFusing;
     MaxFixedBufferSize          = maxFixedBufferSize;
     SyncProcessingLimit         = syncProcessingLimit;
     StreamRefSettings           = streamRefSettings;
 }
예제 #6
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"))));
        }