Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pause/resume for tasks #250

Open
pschrammel opened this issue Jul 16, 2024 · 1 comment
Open

pause/resume for tasks #250

pschrammel opened this issue Jul 16, 2024 · 1 comment

Comments

@pschrammel
Copy link
Contributor

I implemented a naive pushback example (https://github.com/socketry/falcon/tree/main/examples/pushback) but it has some quirks:

  1. I had to implement an external loop to check for free slots (this causes a certain delay but doesn't explain delays of 500ms)
  2. the task does a kind of busy waiting (checking if it's allowed to continue). This keeps the async event loop busy (guessing). I think the major delay comes from this waiting loop.

I will try to implement something more nio4r compatible (I'm currently thinking of named pipes and reading to "pause" a task and write to "resume" a task). But perhaps a "pause"/"resume" could be implemented into the framework. currently a task can only be "stopped" and that's it.

@ioquatix
Copy link
Member

I feel like in order for this to work generally, it would be better to use a shared source of truth for rate limiting.

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

No branches or pull requests

2 participants