dabeaz / curio

Good Curio!
Other
4.01k stars 240 forks source link

Enable customization of TimeQueue and Kernel's use of it #285

Closed akalsi87 closed 5 years ago

akalsi87 commented 5 years ago

Allow the construction of a TimeQueue with a specified timeslice, base and bucketcount.


This is my first Python PR. If I am not abiding (yes I know it's a function) by certain guidelines, I am happy to adopt the suggestions into the PR.

Testing

(11:25:44) | akalsi@archlinux | akalsi/code/curio (tunable-timqueue)
$ env PYTHONPATH=. pytest
...
=========== 258 passed, 2 skipped, 4 warnings in 98.85 seconds ============
akalsi87 commented 5 years ago

The other thought I had was to pass a TimeQueue directly to run/Kernel.__init__. I thought this was encapsulated better.

dabeaz commented 5 years ago

I'm just now getting caught up on some PRs from the last few weeks. Given that this was closed before I got to it, are you going in a different direction with it right now?

akalsi87 commented 5 years ago

I wasn't sure if you're interested in the change. I plan to go in the same direction, if you're open to the PR.

dabeaz commented 5 years ago

My inclination is to not introduce additional options to the Kernel at this time. However, I can introduce a time slice as a class variable on TimeQueue and make it something that can be tweaked. In the big picture, I guess I'd like to see more data as to how this impacts things before expanding it into a general configuration option in the API.