Skip to content

[Feature Request] Support dynamic worker registration at runtime #657

@oatiz

Description

@oatiz

Summary

I'd like to request support for dynamically registering workers at runtime, rather than only at application startup.

Use Case

In my application, I need to add workers dynamically based on runtime conditions, such as:

  • User-defined task types loaded from a database/configuration
  • Adding new job handlers without restarting the application

Current Behavior

Currently, workers must be registered before calling Monitor::run():

Monitor::::new()
    .register(worker1)
    .register(worker2)
    .run()
    .await

Once run() is called, there's no way to add additional workers.

Questions

  1. Is this use case something you've considered?
  2. Are there architectural constraints that make this difficult to implement?
  3. Is there a workaround I might be missing?

Thank you for this excellent library! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions