简体   繁体   中英

twisted reactor: priority and insights

Two simple questions about twisted reactor:

  1. Is there a way to explicitly assign a priority while scheduling a task ?

  2. Is it possible to inspect the reactor in order to list all the pending tasks?

No. The reactor does not implement priority-based scheduling; it just runs events in whatever order they happen to come back from your multiplexing/timing mechanism, depending on the particular reactor implementation (it's slightly different for the different ones).

Implementing a scheduling or fair queueing API in the reactor would be an awesome addition, but it would be a non-trivial amount of work.

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