Skip to content

NATS scheduling feature #6381

@tamis-laan

Description

@tamis-laan

Proposed change

Something like this would be sooooo helpful:

ns = await nats.connect("localhost:4222")

await ns.cron.set("my_periodic_task_id", "*/1 * * * *", "my_topic",  "my message".encode())

await ns.cron.set("my_one-shot_task_id", "2025-04-20T18:40:00+02:00", "my_topic",  "my message".encode())

task = await ns.cron.get("my_one-shot_task_id")

await ns.cron.del("my_periodic_task_id")

When these tasks are one shot they should be automatically be removed after triggering and sending their message to the target topic.

Use case

In case we are dealing with timed events that need to be processed. For example when we are dealing with calendar (ical) events or having to send out emails etc...

Contribution

I'm not familiar with the NATS code base but would be happy to contribute with support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalEnhancement idea or proposalstaleThis issue has had no activity in a while

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions