kytos-ng / kytos

Kytos SDN Platform. Kytos is designed to be easy to install, use, develop and share Network Apps (NApps).
https://kytos-ng.github.io/
MIT License
2 stars 7 forks source link

Evolve `listen_to` decorator to allow support a dynamic single worker ThreadPool #397

Closed viniarck closed 11 months ago

viniarck commented 1 year ago

Historic context:

Motivation / Use cases:

Main benefit:

Another altenative that we've been liveraging is the alisten_to async handler, which can also help since it has cooperative preemption and it's easier to control if the task will yield or not and deal with or protect any concurrent rw, but in we still have a synchronous db driver pymongo and we can't always reach out to alisten_to yet, so having this option to use a dynamic single worker fifo handler would be great, which also wouldn't break any compatibility and then application handlers could start to use it when appropriate.