Stopping workers with terminate

Not all problems are cumulative. Some have a desired goal state; once it is found, then the program can exit. We've seen that workers communicate their results by posting messages. Now our program is completed, it would be nice to prevent future messages from being received, possibly polluting our results.

In this recipe, we'll see how to use Worker.terminate to immediately stop a Worker.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.166.127