/// <summary> /// Merges multiple channels of same contract into single /// producer for broadcasting messages via all channels. /// </summary> /// <param name="first">The first channel.</param> /// <param name="second">The second channel.</param> /// <param name="others">The others channels.</param> /// <returns></returns> /// <exception cref="NotImplementedException"></exception> IProducerHooksBuilder IProducerBuilder.Merge( IProducerHooksBuilder first, IProducerHooksBuilder second, params IProducerHooksBuilder[] others) { #region Validation if (Plan == null) { throw new ArgumentNullException(nameof(Plan)); } #endregion // Validation var prms = Plan.AddForward(first); prms = prms.AddForward(second); return(new ProducerBuilder(prms)); }
public ProducerPlan AddForward(IProducerHooksBuilder forward) { return(new ProducerPlan(this, forwards: Forwards.Add(forward))); }
/// <summary> /// Adds the route. /// </summary> /// <param name="route">The route.</param> /// <returns></returns> public ProducerPlan AddRoute(IProducerHooksBuilder route) { return(new ProducerPlan(this, routes: Routes.Add(route))); }