Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First off, @akitaonrails, thank you for creating this! It's exactly what I needed for my project.
I upgraded to Crystal 1.1.1 and everything broke, though :( I saw also that #3 refers to the same issue.
So I dug in, and in I did a small refactor for compatibility with Crystal 1.1.1
The issue is that the Crystal team made
Channel::StrictReceiveAction
private in #9564 and, in general in other discussions, has discouraged folks from using internal Channel implementation details. So really, we should just be using Channel#send and Channel#receive.So I modified the code here slightly to do that. Instead of an array of Channels (one for each worker), I'm using a single communication channel and the array stores references to the workers themselves.
This is a first stab at a solution and I'm sure it can be improved / cleaned-up, but it works! I'm happily chugging along again.