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

Automated processing and signal handling #50

Open
martint17r opened this issue Oct 27, 2014 · 0 comments
Open

Automated processing and signal handling #50

martint17r opened this issue Oct 27, 2014 · 0 comments

Comments

@martint17r
Copy link

I wrote a small script to multiplex a tube into multiple other tubes: https://github.com/martint17r/beanstalk-multiplex

I would like to harden it against data loss, i.e. when the script gets interrupted, it should still process the current job and only after finishing it, exit the processing loop and close the connection to the beanstalkd.
If there is no job being processed it would be best to close the connection and immediately exit.

I tried using trap(...) but it requires some jumping through burning hoops to bring the signal into the processing loop.

What is the best way to achieve proper signal handling?

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

1 participant