public virtual T DequeueFromInput(bool isPeek, bool useTimeout = false) { sw = DateTime.Now; T qItem = default(T); while (1 == 1) { if (useTimeout) { if ((DateTime.Now - sw).TotalMilliseconds > timeoutMS) { break; } } if (InQ.Count == 0) { Task.Run(async() => await Task.Delay(waitTimeMS)).Wait(); continue; } if (isPeek) { if (!InQ.TryPeek(out qItem)) { Task.Run(async() => await Task.Delay(waitTimeMS)).Wait(); continue; } else { break; } } else { if (!InQ.TryDequeue(out qItem)) { Task.Run(async() => await Task.Delay(waitTimeMS)).Wait(); continue; } else { break; } } } return(qItem); }
public OutQ Query(InQ inQ) { return new OutQ(); }
public virtual void EnqueueToInput(T message) { InQ.Enqueue(message); }
public OutQ Query(InQ inQ) { return(new OutQ()); }