{"push_id":862043320,"size":1,"distinct_size":1,"ref":"refs/heads/jcr-change-worker-callbacks","head":"ac8de8103f055cc7789abd548c3d57e4cb7df2e8","before":"49ed2866a213e609cb5684b3863c4dca258bf940","commits":[{"sha":"ac8de8103f055cc7789abd548c3d57e4cb7df2e8","author":{"email":"4ce87f5ca5596825d366b739cd5c4750d74e0217@gmail.com","name":"Collin Redding"},"message":"Change worker callbacks, instance exec and begin-rescue them\n\nThis changes the worker callbacks to be instance exec'd, wraps\nthe on-start and on-shutdown in begin-rescues and changes the\nworker to spawn itself with the runner when its started. This is\nto make the callbacks more consistent and safer (keep them from\nmessing up the worker behavior).\n\nThe worker callbacks are now instance exec'd instead of being\ncalled. This makes them more consistent with the `work!` method\nand lets them easily access the queue and params.  As part of this,\nthe internal methods and ivars for the workers behavior have been\nnamespaced to avoid user defined methods and ivars.\n\nThis also wraps the on-start and on-shutdown callbacks in\nbegin-rescues. This is to ensure that if they raise an error, the\non-error callbacks get called. This also tries to keep the errors\nfrom keeping workers from starting or shutting down incorrectly.\n\nFinally, this changes the worker to call a `spawn_worker` method\non the runner when it starts. This is consistent with how it calls\n`despawn_worker` when it shuts down. The `spawn_worker` adds the\nworker to the runners workers just like the `despawn_worker`\nremoves it. This makes sure we don't add the worker to the\ncollection before the thread has started and gotten to run (meaning\nits actually processing work).","distinct":true,"url":"https://api.github.com/repos/redding/dat-worker-pool/commits/ac8de8103f055cc7789abd548c3d57e4cb7df2e8"}]}