public void PollReturnsWhenSignaledTest() { var wait = new ManualResetEvent(true); var poller = new InActivityPoller<EventWaitHandle>(wait, PollingFunc); poller.Poll(); Assert.Pass("Event signaled releaseing thread."); }
public void RetrieveMarketData(string providerid, DataReceivedHandler datareceivedhandler, CancellationToken token) { if (null == datareceivedhandler || string.IsNullOrEmpty(providerid)) throw new ArgumentNullException(); ProviderId = providerid; _token = token; OnDataReceived = datareceivedhandler; InitializeDatafeed(); EstablishSession(); //Poll for completion or inactivity var poller = new InActivityPoller<ManualResetEvent>(waitHandle, KeepPolling, ProviderInactivtyTimeOutInMilliseconds); poller.Poll(); }