There are a couple of articles on this, and I have this working...but I want to know how to set a max number of Task threads for my Observable subscriptions at once.
I h
If you create your "work" as IObservable
with deferred execution (ie. they want do anything until subscribed to), you can use the Merge
overload that accepts a number of maximum concurrent subscriptions:
ISubject synchronizedQueue = new Subject().Synchronize();
queue
.Select(item => StartWork(item))
.Merge(maxConcurrent: 5) // C# 4 syntax for illustrative purposes
.Subscribe();
// To enqueue:
synchronizedQueue.OnNext(new QueueItem());