albrow / jobs

A persistent and flexible background jobs library for go.
MIT License
499 stars 47 forks source link

Intercept UNIX signals #7

Open albrow opened 9 years ago

albrow commented 9 years ago

Currently, if you cause a worker pool process to quit by sending a UNIX signal (e.g. by pressing ctrl-c), it will quit immediately without waiting for jobs to finish executing. This is good behavior for testing purposes (because it lets me simulate hard failures), but ideally the process should intercept certain types of signals and wait before exiting.

epelc commented 9 years ago

+1 for this and also for making sure it works when your running in a docker container.

albrow commented 9 years ago

@epelc, thanks for your feedback. I'm targeting this for version 0.3.1. Can you elaborate on what is required in order to be compatible with docker? AFAIK there is nothing that would make it incompatible, but I'm only played around with docker a little.

epelc commented 9 years ago

@albrow I don't think anything you do would be inherit nay incompatible. I just thought it'd be a good idea to test it with docker.

I'd test that it works with docker stop and possibly docker kill. Let me know if you need any help testing.

albrow commented 9 years ago

:ok_hand: