I built a Worker class using Rx:
class Worker<TInput>
{
private Subject<TInput> subject;
public Worker(Action<TInput> processingAction)
{
subject = new Subject<TInput>();
subject.Subscribe(processiongAction);
}
public void PostData(TInput data)
{
subject.OnNext(data);
}
}
There are 2 things I want to accomplish:
Control the concurrency (max parallel threads) of the observable.
block the posting thread if the are too much processingAction active
How do I do it?
Thanks