New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #554 - Adding Farmers::Fork #567
Conversation
Job #567 is now in scope, role is |
@emilianodellacasa what's the point of doing |
@emilianodellacasa you are saying "instead" but your code still calls |
Codecov Report
@@ Coverage Diff @@
## master #567 +/- ##
==========================================
- Coverage 34.62% 34.42% -0.21%
==========================================
Files 65 65
Lines 2992 3027 +35
==========================================
+ Hits 1036 1042 +6
- Misses 1956 1985 +29
Continue to review full report at Codecov.
|
@yegor256 Ooooops, sorry about that, now the code makes sense :-) |
@emilianodellacasa still a miss. You don't need to use posix processes inside |
@yegor256 I don't get it: I need a separate process to run the command that calculates the score, this is the reason why I am using another process for it. |
@emilianodellacasa you get that process by calling
|
@yegor256 You are definitely right, I was missing the whole concept of |
lib/zold/node/farmers.rb
Outdated
write.close | ||
output = read.read | ||
buffer = output.split('|')[0] | ||
proc_pid = output.split('|')[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilianodellacasa how many more pid
-s you have here? https://www.yegor256.com/2015/01/12/compound-name-is-code-smell.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yegor256 Done
lib/zold/node/farmers.rb
Outdated
|
||
def up(score) | ||
start = Time.now | ||
read, write = IO.pipe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilianodellacasa I would rename them to stdin
and stdout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yegor256 Done
lib/zold/node/farmers.rb
Outdated
Process.wait | ||
write.close | ||
output = read.read | ||
buffer = output.split('|')[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilianodellacasa you can do:
buffer, pid = output.split('|')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yegor256 Right, done
@emilianodellacasa see above |
* upstream/master: zold-io#572 tested and fixed Issue zold-io#537 - Test modified for pushing Issue zold-io#537 - Test modified for fecthing Issue zold-io#537 - Fixing rubocop code smells Change link of travis build status to master branch in README Issue zold-io#537 - --threads for PUSH and FETCH zold-io#568 new location of lock files zold-io#568 Remotes thread safety zold-io#568 --queue-limit zold-io#566 fixed zold-io#563 --no-cache Isse zold-io#553 - Excluding memory-dump from test
@yegor256 All done, see my commits |
@rultor merge |
Job |
The job #567 is now out of scope |
To solve issue #554 I added the new class
Farmers::Fork
that is usingProcess.fork
instead ofOpen3
Please note that inside the library,
Farmers::Spawn
is still the default