.net - Async Queue Processing With Reactive Extensions -


there couple of articles on this, , have working...but want know how set max number of task threads observable subscriptions @ once.

i have following parallelize async saving of log entries:

private blockingcollection<ilogentry> logentryqueue; 

and

 logentryqueue = new blockingcollection<ilogentry>();  logentryqueue.getconsumingenumerable().toobservable(scheduler.taskpool).subscribe(savelogentry); 

to schedule saving...but how specify max threads scheduler use @ once?

this not function of observable, function of scheduler. observable defines what , scheduler defines where.

you'd need pass in custom scheduler. simple way subclass taskscheduler , override "maximumconcurrencylevel" property.

http://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler.maximumconcurrencylevel.aspx

i found sample of on msdn:

http://msdn.microsoft.com/en-us/library/ee789351.aspx

edit: asked how go taskscheduler ischeduler. developer gave me little bit of info:

var ischedulerforrx = new taskpoolscheduler (     new taskfactory     (         //this custom scheduler         new limitedconcurrencyleveltaskscheduler(1)     ) ); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -