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 DirectoryMonitor(string directory) { _baseDirectory = directory; _coordinatorChannel = AddressRegistry.GetOutboundCoordinatorChannel(); _fiber = new ThreadPoolFiber(); }