Skip to content

Controller for task admission#40

Merged
mr-chelyshkin merged 11 commits intomainfrom
controller-v2
Oct 22, 2025
Merged

Controller for task admission#40
mr-chelyshkin merged 11 commits intomainfrom
controller-v2

Conversation

@mr-chelyshkin
Copy link
Contributor

📝 Description

Add new feature object: controller which can manage task admission with a few rules:

  • Skip task if already running.
  • Stop current task and start new one immediately.
  • Queue the task (FIFO order).

🔄 Related Issues

Resolves #39 (if applicable)

✅ Checklist

  • Documentation updated (README, rustdoc, examples)
  • Tests added/updated (if relevant)
  • No breaking changes introduced
  • CI passes locally

📸 Screenshots / Logs (if applicable)

// Supervisor as a Builder
let sup = Supervisor::builder(Config::default())
        .with_subscribers(vec![Arc::new(LogWriter::default())])
        .with_controller(ControllerConfig::default())
        .build();
        
// New wrapper example
sup.submit(ControllerSpec::queue(my_awesome_worker)).await?
sup.submit(ControllerSpec::replace(my_awesome_worker)).await?;

@mr-chelyshkin mr-chelyshkin changed the title Controller v2 Controller for task admission Oct 22, 2025
@mr-chelyshkin mr-chelyshkin merged commit 147aaec into main Oct 22, 2025
4 checks passed
@mr-chelyshkin mr-chelyshkin deleted the controller-v2 branch October 22, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add admission policy for tasks

1 participant