Ejemplo n.º 1
0
        internal static IIngressStreamable <Empty, TPayload> ToCheckpointableStreamable <TPayload>(
            this IObservable <TPayload> streamEvents,
            FlushPolicy flushPolicy,
            PeriodicPunctuationPolicy periodicPunctuationPolicy,
            OnCompletedPolicy completedPolicy,
            TimelinePolicy timelinePolicy,
            QueryContainer container,
            string identifier)
        {
            Contract.EnsuresOnThrow <IngressException>(true);

            if (periodicPunctuationPolicy == null)
            {
                periodicPunctuationPolicy = PeriodicPunctuationPolicy.None();
            }

            return(new MonotonicIngressStreamable <TPayload>(
                       streamEvents,
                       flushPolicy,
                       periodicPunctuationPolicy,
                       completedPolicy,
                       timelinePolicy ?? TimelinePolicy.WallClock(),
                       container,
                       identifier));
        }
Ejemplo n.º 2
0
        internal static IIngressStreamable <Empty, TPayload> ToCheckpointableStreamable <TPayload>(
            this IObservable <ArraySegment <TPayload> > streamEvents,
            OnCompletedPolicy completedPolicy,
            TimelinePolicy timelinePolicy,
            QueryContainer container,
            string identifier)
        {
            Contract.EnsuresOnThrow <IngressException>(true);

            // For the moment, there is no way to support array-based ingress with a timeline policy and a punctuation policy
            if (timelinePolicy.timelineEnum == TimelineEnum.WallClock && timelinePolicy.punctuationInterval == default(TimeSpan))
            {
                throw new NotSupportedException("There is currently no support for array-based ingress based on clock time with punctuations.  For the moment, either switch to a sequence-based policy or remove the punctuation period parameter.");
            }
            return(new MonotonicArrayIngressStreamable <TPayload>(
                       streamEvents,
                       completedPolicy,
                       timelinePolicy ?? TimelinePolicy.WallClock(),
                       container,
                       identifier));
        }