简体   繁体   中英

reactor thread pool dispatcher

I went through reactor documentation, but I am unclear on how I can have some control over how many events are being dispatched at any given time. What I would like to do is dispatch a bunch of events, enough to keep some consumers busy, but then have some way of knowing I have enough consumers working at the moment so I shouldn't dispatch any more events. I was thinking if I set the dispatcher to use Threadpool then at some point it will not allocate any more threads and possibly throw a rejection exception. This way I can keep dispatching events until I receive a thread rejection exception.

Is there some way to do this or am I using reactor in a way that it's not supposed to be used.

一种方法是将待办事项的大小保持为零,这样它将满足您的需求!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM