1

I am creating tasks by inheriting from Greenlet. I have a single parent task that calls start() on two children in its _run(). Elsewhere (it happens to be a systemd service) start() and join() are called.

The behavior seems correct. For example the use of a Queue with timeouts achieves the desired effect but I haven't found a good way to shutdown the children from say KeyboardInterrupt or by registering a callback to the parent task for SIGTERM. In the handler I would call child1.kill() and 'child2.kill()but only the first called seemed to raiseGreenletExit`.

I never call join() on the children and I'm not sure how I would do this properly. Am I misusing the library?

Kenny
  • 675
  • 10
  • 24

1 Answers1

0

My error was that I was handling gevent.greenlet.GreenletExit in the child tasks. If you need to handle the exit you can catch and reraise this exception.

Kenny
  • 675
  • 10
  • 24