Esempio n. 1
0
            public QueryContent(int id, Consumer <MyContent> callback)
            {
                Id = id;

                var queue = new ThreadPoolFiber();
                Channel <MyContent> channel = new ConsumerChannel <MyContent>(new SynchronousFiber(), callback);

                if (SynchronizationContext.Current != null)
                {
                    channel = new SynchronizedChannel <MyContent>(queue, channel, SynchronizationContext.Current);
                }
                ResponseChannel = channel;
            }
Esempio n. 2
0
			public QueryContent(int id, Consumer<MyContent> callback)
			{
				Id = id;

				var queue = new ThreadPoolFiber();
				Channel<MyContent> channel = new ConsumerChannel<MyContent>(new SynchronousFiber(), callback);

				if (SynchronizationContext.Current != null)
				{
					channel = new SynchronizedChannel<MyContent>(queue, channel, SynchronizationContext.Current);
				}
				ResponseChannel = channel;
			}
Esempio n. 3
0
        protected virtual Channel <T> Visitor <T>(SynchronizedChannel <T> channel)
        {
            Visit(channel.Output);

            return(channel);
        }