Esempio n. 1
0
 /// <summary>
 /// Adds a preprocessor.
 /// </summary>
 /// <typeparam name="T">The event type.</typeparam>
 /// <param name="self">The configuration builder.</param>
 /// <param name="preprocessor">The preprocessor to add.</param>
 /// <returns>The same configuration builder instance to allow a fluent syntax.</returns>
 public static HubConfigurationBuilder <T> AddPreprocessor <T>(this HubConfigurationBuilder <T> self, IRoutablePreprocessor <T> preprocessor)
     where T : IRoutable
 {
     if (preprocessor == null)
     {
         throw new ArgumentNullException(nameof(preprocessor));
     }
     self.Preprocessors.Add(preprocessor);
     return(self);
 }
Esempio n. 2
0
 /// <summary>
 /// Adds a router.
 /// </summary>
 /// <typeparam name="T">The event type.</typeparam>
 /// <param name="self">The configuration builder.</param>
 /// <param name="router">The router to add.</param>
 /// <returns>The same configuration builder instance to allow a fluent syntax.</returns>
 public static HubConfigurationBuilder <T> AddRouter <T>(this HubConfigurationBuilder <T> self, IRouter <T> router)
     where T : IRoutable
 {
     if (router == null)
     {
         throw new ArgumentNullException(nameof(router));
     }
     self.Routers.Add(router);
     return(self);
 }
Esempio n. 3
0
 /// <summary>
 /// Set the maximum number of routables to forward at once.
 /// </summary>
 /// <typeparam name="T">The event type.</typeparam>
 /// <param name="self">The configuration builder.</param>
 /// <param name="value">The count.</param>
 /// <returns>The same configuration builder instance to allow a fluent syntax.</returns>
 public static HubConfigurationBuilder <T> SetMaximumRoutablesForwardingCount <T>(this HubConfigurationBuilder <T> self, int value)
     where T : IRoutable
 {
     self.MaximumRoutablesForwardingCount = value;
     return(self);
 }
Esempio n. 4
0
 /// <summary>
 /// Sets the time to wait for more routables to be forwarded
 /// before actually starting to forward any routables.
 /// </summary>
 /// <typeparam name="T">The event type.</typeparam>
 /// <param name="self">The configuration builder.</param>
 /// <param name="value">The delay.</param>
 /// <returns>The same configuration builder instance to allow a fluent syntax.</returns>
 public static HubConfigurationBuilder <T> SetWaitForMoreRoutablesForwardingDelay <T>(this HubConfigurationBuilder <T> self, TimeSpan value)
     where T : IRoutable
 {
     self.WaitForMoreRoutablesForwardingDelay = value;
     return(self);
 }
Esempio n. 5
0
 /// <summary>
 /// Sets the maximum length of the queue for routables.
 /// </summary>
 /// <typeparam name="T">The event type.</typeparam>
 /// <param name="self">The configuration builder.</param>
 /// <param name="value">The maximum queue length.</param>
 /// <returns>The same configuration builder instance to allow a fluent syntax.</returns>
 public static HubConfigurationBuilder <T> SetMaximumRoutableQueueLength <T>(this HubConfigurationBuilder <T> self, int value)
     where T : IRoutable
 {
     self.MaximumRoutableQueueLength = value;
     return(self);
 }