public MonotonicEgressPipe(
     IObserver <TPayload> observer,
     QueryContainer container)
     : base(observer, container)
 {
 }
 public ReactiveEgressPipe(
     IObserver <TPayload> observer,
     QueryContainer container)
     : base(observer, container)
 {
 }
        public BinaryIngressStreamable(Stream binaryStream, int numMessages, IIngressScheduler scheduler, StreamProperties <TKey, TPayload> inputProperties, bool readPropertiesFromStream, QueryContainer container, string identifier)
            : base((inputProperties ?? StreamProperties <TKey, TPayload> .Default).SetQueryContainer(container))
        {
            if (readPropertiesFromStream)
            {
                var propSer = StreamSerializer.Create <SerializedProperties>();
                var props   = propSer.Deserialize(binaryStream);
                this.properties = props.ToStreamProperties <TKey, TPayload>();
            }

            this.stream = binaryStream;
            if (this.stream.CanSeek)
            {
                this.streamStartPosition = binaryStream.Position;
            }
            this.numMessages           = numMessages;
            this.scheduler             = scheduler;
            this.container             = container;
            this.IngressSiteIdentifier = identifier ?? Guid.NewGuid().ToString();
            this.delayed = container != null;
            if (this.delayed)
            {
                container.RegisterIngressSite(identifier);
            }
        }
Example #4
0
        /// <summary>
        /// Registers an IStreamable object as an output of a query, with output as a progressively changing enumerable.
        /// </summary>
        /// <typeparam name="TPayload">The type of the payload of the data source.</typeparam>
        /// <param name="container">A query container to which this egress point can be attached.</param>
        /// <param name="stream">An IStreamable object that is intended to be an output to the query.</param>
        /// <param name="identifier">A string that can uniquely identify the point of egress in the query.</param>
        /// <returns>An IObservable object of change list events for output data from the query.</returns>
        public static EvolvingStateEnumerable <TPayload> RegisterOutputAsEnumerable <TPayload>(this QueryContainer container, IStreamable <Empty, TPayload> stream, string identifier = null)
        {
            Invariant.IsNotNull(stream, nameof(stream));

            return(stream.ToEnumerable(container, identifier ?? Guid.NewGuid().ToString()));
        }
        public StreamMessageIngressStreamable(IObservable <StreamMessage <Empty, TPayload> > source, StreamProperties <Empty, TPayload> properties, QueryContainer container, string identifier)
            : base(properties.SetQueryContainer(container))
        {
            Contract.Requires(source != null);

            this.source    = source;
            this.container = container;
            this.delayed   = container != null;

            this.identifier = identifier;
            if (this.delayed)
            {
                container.RegisterIngressSite(identifier);
            }
        }
Example #6
0
        public BinaryIngressStreamablePassive(Stream binaryStream, StreamProperties <TKey, TPayload> inputProperties, bool readPropertiesFromStream, QueryContainer container, string identifier)
            : base((inputProperties ?? StreamProperties <TKey, TPayload> .Default).SetQueryContainer(container))
        {
            if (readPropertiesFromStream)
            {
                var propSer = StreamSerializer.Create <SerializedProperties>();
                var props   = propSer.Deserialize(binaryStream);
                this.properties = props.ToStreamProperties <TKey, TPayload>();
            }

            this.stream                = binaryStream;
            this.serializer            = StreamSerializer.Create <QueuedMessage <StreamMessage <TKey, TPayload> > >(new SerializerSettings());
            this.container             = container;
            this.IngressSiteIdentifier = identifier ?? Guid.NewGuid().ToString();
            container?.RegisterIngressSite(identifier);
            this.restored = container == null;
        }