示例#1
0
        /// <summary>
        /// Responsible of building instance from segmented data.
        /// Segmented data is how the producer sending its raw data to
        /// the consumer. It's in a form of dictionary when
        /// keys represent the different segments
        /// and the value represent serialized form of the segment's data.
        /// </summary>
        /// <param name="segmentationStrategy">The segmentation strategy.</param>
        /// <returns></returns>
        /// <example>
        /// Examples for segments can be driven from regulation like
        /// GDPR (personal, non-personal data),
        /// Technical vs Business aspects, etc.
        /// </example>
        IConsumerHooksBuilder IConsumerHooksBuilder.RegisterSegmentationStrategy(IConsumerAsyncSegmentationStrategy segmentationStrategy)
        {
            var prms   = _plan.AddSegmentation(segmentationStrategy);
            var result = new ConsumerBuilder(prms);

            return(result);
        }
示例#2
0
 /// <summary>
 /// Adds the segmentation.
 /// </summary>
 /// <param name="segmentation">The segmentation.</param>
 /// <returns></returns>
 internal ConsumerPlan AddSegmentation(
     IConsumerAsyncSegmentationStrategy segmentation)
 {
     return(new ConsumerPlan(this,
                             segmentationStrategies: SegmentationStrategies.Add(segmentation)));
 }