Make sure and let long polling finish before shutting down
Fixes #31.
This makes sure that we don't kill the worker process during a long poll. This will allow the long poll to complete, finish any task returned by the long poll and then kill the process. We could in theory terminate faster if we could cancel the long poll, but it appears that the AWS SDK doesn't allow that.
See my comments #31 for a better explanation of the bug and it's root cause.
Anyone at AWS have any thoughts on this? If its the right thing to do, then I would like to merge this so I can delete my fork.
Any thoughts on this. It's been almost a year. If there are changes that need to be made, I'd be happy to do them.