-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
deprecate spawn(cmd)
to run(cmd, wait=false)
#26130
Conversation
a447990
to
2730ec7
Compare
61bc0ef
to
4892618
Compare
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.
I thought I was going to be annoyed by run
returning the process object when called with wait=true
but I'm actually not – I like that it returns the process object. It lets people see that there is a process object wrapping a command with a return code, all of which is good for people to be aware of.
4892618
to
035ad58
Compare
base/process.jl
Outdated
|
||
function eachline(cmd::AbstractCmd; chomp=nothing, keep::Bool=false) | ||
if chomp !== nothing | ||
keep = !chomp | ||
depwarn("The `chomp=$chomp` argument to `eachline` is deprecated in favor of `keep=$keep`.", :eachline) | ||
end | ||
stdout = Pipe() | ||
processes = spawn(cmd, (DevNull,stdout,STDERR)) | ||
processes = _spawn(cmd, (DevNull,stdout,STDERR)) |
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.
Are we now unable to open a process without reaching into the internal API?
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.
I don't think so. Is there a case not covered by open
and pipeline
?
Is there any reason to not use a positive and direct form like rather than a double negation |
"Don't wait" seems more obvious to me than "do run asynchronously". Similarly, "do wait" is significantly clearer than "don't run asynchronously" which is a double negative form of "run synchronously" which I still have to translate in my head to "do wait". |
I think about parallelism in terms of motion and lanes. I stop using mental representation in natural languages very shortly. So no need to escape the hell of understanding things like "don't run asynchronously". that's sound too much convoluted and error-prone for me. my habits when talking about distributed processing is : use symbols that match to graph as closer as possible. Stick with them as long as possible. |
I agree with Stefan here. While In terms of how asynchronous programming is normally described and implemented, the two primitive operations are "run asynchronously" and "wait", not "run asynchronously" and "run synchronously". |
b65d1ba
to
78037ef
Compare
Hmm, this is printing an extra |
78037ef
to
ba0c037
Compare
add `read` and `write` keyword arguments to `open` for processes fixes #25965
ba0c037
to
1f8f54f
Compare
pkg tests seem to have network issues on OS X sometimes. |
…luenonscalarindexedassignment * origin/master: (28 commits) fix an optimizer bug in `invoke` with non-constant functions (#26301) lower top-level statements in such a way that the front-end knows (#26304) Make sure Sockets page has h1 header (#26315) fix doctests, and make them less prone to errors (#26275) FIx intro to manual chapter on types (#26312) Add a missing "that" (#26313) fix docstring for code_llvm (#26266) Remove the examples/ folder (#26153) download cert.pem from deps-getall, fixes #24903 (#25344) Slight update to doc string for at-enum to refer to instances (#26208) performance tweak in reverse(::String) (#26300) remove references to `TCPSocket` in Base docstrings (#26298) Deprecate adding integers to CartesianIndex (#26284) Deprecate conj(::Any), add real(::Missing) and imag(::Missing) (#26288) fix #26267, regression in `names` with `imported=false` (#26293) fix #25857, `typeinfo` problem in showing arrays with abstract tuple types (#26289) Add adjoint(::Missing) method (#25502) Use lowered form in logging macro (#26291) deprecate bin, oct, dec, hex, and base in favor of `string` and keyword args (#25804) deprecate `spawn(cmd)` to `run(cmd, wait=false)` (#26130) ...
This broke CoverageBase, which calls |
¯\_(ツ)_/¯ |
Also add
read
andwrite
keyword arguments toopen
for processes.fixes #25965