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; }
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; }
protected virtual Channel <T> Visitor <T>(SynchronizedChannel <T> channel) { Visit(channel.Output); return(channel); }