0

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:

  1. Control the concurrency (max parallel threads) of the observable.

  2. block the posting thread if the are too much processingAction active

How do I do it?

Thanks

0 Answers0