Skip to content

Add support for background execution on application services #306

Description

@garciparedes

Proposed solution:

The proposed solution is to allow to pass the @reboot label to the @enroute.periodic.event decorator, which means that the handling function will be executed only once, at microservice's starting time.

Note that this handling function could be running indefinitely thanks to infinite loops or another related strategies.

class MyService(Service):

    @enroute.periodic.event("@reboot")
    async def task(self, request: Request) -> None:
        print("Running task only once...")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions