ask / mode

Python AsyncIO Services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add `add_timer` functionality

pohmelie opened this issue · comments

For fast prototyping Service.timer decorator is enough, but for flexible solution this need to be improved because this do not allows to:

  • Set timer interval at runtime (from config, cli, etc.)
  • Stop timer
  • Add timer at runtime

I think best approach here is pretty similar to others add_* methods. Something like add_timer will create new timer and return handle to manipulate (stop) it.