Skip to content

Automated processing and signal handling #50

@martint17r

Description

@martint17r

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?

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