Skip to content

Support for timers #2

@woile

Description

@woile

Goal

Execute scheduled functions

Discussion

Ideas

1. Decorator

from dam import send, timer

@timer(ms=20)
async def hello():
    send("a-topic", {"name": "jon"}

2. Add them in a list

This would follow a similar approach to routes

from dam import Timer, App
from .myapp import hello

timers = [
    Timer(hello, ms=20)
]

App(timers=timers)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions