Ejemplo n.º 1
0
        /// <summary>
        /// INTERNAL API
        ///
        /// Measures rolling interval between immediately subsequent `matching(o: O)` elements.
        /// </summary>
        public static IFlow <TIn, TMat> TimedIntervalBetween <TIn, TMat>(IFlow <TIn, TMat> flow, Func <TIn, bool> matching, Action <TimeSpan> onInterval)
        {
            var timedInterval =
                Flow.Create <TIn>()
                .Transform(() => new TimedIntervall <TIn>(matching, onInterval))
                .Named("timedInterval");

            return(flow.Via(timedInterval));
        }
Ejemplo n.º 2
0
 GroupedByCountAndRawCaptureSizeWithin <TProcessRawPacketRequest, TMat>(this IFlow <TProcessRawPacketRequest, TMat> flow,
                                                                        Int32 count,
                                                                        Int32 rawCapturesSizeLimit,
                                                                        TimeSpan timeout)
 {
     if (count <= 0)
     {
         throw new ArgumentException("count must be > 0", nameof(count));
     }
     if (rawCapturesSizeLimit <= 0)
     {
         throw new ArgumentException("RawCapturesSizeLimit must be > 0", nameof(rawCapturesSizeLimit));
     }
     if (timeout == TimeSpan.Zero)
     {
         throw new ArgumentException("Timeout must be non-zero", nameof(timeout));
     }
     return(flow.Via(
                (IGraph <FlowShape <TProcessRawPacketRequest, IEnumerable <TProcessRawPacketRequest> >, NotUsed>)
                new GroupedByCountAndRawCaptureSizeWithin(count, rawCapturesSizeLimit, timeout)));
 }