Open gagarski opened 2 years ago
Reactive streams provides certain guarantees wrt visibility. So, its a reasonable expectation that all libraries that embrace asynchrony give JMM guarantees wrt framework callbacks (or) at the least document guarantees the library does & doesnt provide.
Reference: https://github.com/reactive-streams/reactive-streams-jvm
When it comes to having some state inside NuProcessHandler implementation, some questions arise that cannot be answering by reading the Javadoc. Moreover, some examples in this repo contradicts the ideas about thread-safety that you can get from Javadoc.
onPreStart
visible inonStart
/`onStd/
onExit`**? This is most clear of all< Javadoc saysonStart
visible in `onStd/
onExit** Discussion in #106 and Javadoc suggest that the answer is no. However an example in README.md shows storing
nuProcessinstance in
onStart`. Discussion in #106 suggest that this is wrong.onStdOut
visible in subsequentonStdOut
calls? Are they visible inonExit
call? In other words, can we have something like a giantStringBuilder
to collect stdout of the process?onStdOut
/onStdErr
calls?Integer.MIN_VALUE
fromwaitFor
I'd suggest this to be a naive thing to assume, yet this example shares the state without any synchronization.