# Spawn() documentation update request

**URL:** <https://discourse.julialang.org/t/spawn-documentation-update-request/4668>\
**Category:** General Usage\
**Tags:** question, documentation\
**Created:** [July 5, 2017, 6:10pm UTC](https://discourse.julialang.org/t/spawn-documentation-update-request/4668 "2017-07-05T18:10:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahogen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahogen/32/1993_2.png) [@ahogen](https://discourse.julialang.org/u/ahogen)\
**Post date:** [July 5, 2017, 6:10pm UTC](https://discourse.julialang.org/t/spawn-documentation-update-request/4668/1 "2017-07-05T18:10:55Z")

</div>

Hi all. I’m new to the community so pardon me if I’m not posting in the right area or am asking a dumb question. This looked like the best place to start.

My question/request is simple: **Could documentation for the `spawn()` method be updated?**

I am doing some work with pipes and threads and ended up using the solution [shown here](https://github.com/JuliaLang/julia/issues/11824#issuecomment-228836804). However, the usage of `spawn()` is entirely different from the documentation, which seems to indicate that the only thing you can do with spawn is execute a command as a child process.

> Base.spawn — Function.
> 
> `spawn(command)`
> 
> Run a command object asynchronously, returning the resulting Process object.
> 
> [source](https://github.com/JuliaLang/julia/tree/903644385b91ed8d95e5e3a5716c089dd1f1b08a/base/docs/helpdb/Base.jl#L1273-L1277)

The documentation makes no mention of being able to pass a `StdIOSet` or `Nullable{ProcessChain}` as parameters, which is how the Github issue 11823 used it.

I am new to Julia and working with pipelines in general. Just coming out of some hobbyist-level work with Python, so my experience is limited. However, since `spawn()` seems so useful, and the code is there, it’d be really nice if the documentation reflected its capabilities and was explained clearly.

Thanks and cheers!

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [July 6, 2017, 6:47am UTC](https://discourse.julialang.org/t/spawn-documentation-update-request/4668/2 "2017-07-06T06:47:41Z")

</div>

Asking for help is good, but the best way to actually make this happen is to do it yourself. Julia’s documentation is easy to edit (it’s just plain text with some Markdown), and the particular documentation for spawn() is [right here](https://github.com/JuliaLang/julia/blob/c463c1f49872ac3d1b7c0809d00288c119ed0909/base/docs/helpdb/Base.jl#L1300). You just need to clone the Julia repo, edit the docs, and open a pull request (we can provide pointers to resources if you’re not familiar with the whole pull request thing).

You’re in a great position to do this _right now_ since it sounds like you’re already familiar with what should go into that documentation. Good luck!

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [July 6, 2017, 6:49am UTC](https://discourse.julialang.org/t/spawn-documentation-update-request/4668/3 "2017-07-06T06:49:53Z")

</div>

Oh, and the source for the various `spawn()` methods is here: [https://github.com/JuliaLang/julia/blob/c463c1f49872ac3d1b7c0809d00288c119ed0909/base/process.jl#L394](https://github.com/JuliaLang/julia/blob/c463c1f49872ac3d1b7c0809d00288c119ed0909/base/process.jl#L394)

I found that by doing:

```julia
julia> @edit spawn(`ls -la`)

```

---

<div class="post-metadata">

**Author:** ![ahogen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahogen/32/1993_2.png) [@ahogen](https://discourse.julialang.org/u/ahogen)\
**Post date:** [July 10, 2017, 3:56pm UTC](https://discourse.julialang.org/t/spawn-documentation-update-request/4668/4 "2017-07-10T15:56:27Z")

</div>

That source code is exactly what I found as well.

I wouldn’t mind contributing at all. I am familiar with forking/making pull request as well as Markdown syntax. However, to repeat what I said above, I’m new to both Julia and streams/pipelines so I wouldn’t be able to offer full and complete explanations. Someone would have to come back through and correct me, which doesn’t really help anyone and will confuse those who aren’t familiar with the `spawn()` method.

I can’t make out why there is this `chain::Nullable{ProcessChain}=Nullable{ProcessChain}())` business tacked onto the end of each of the functions/methods, in addition to the `stdios::StdIOSet`.

To differentiate between the **5** different versions of `spawn()`, I assume I’d have to know something about `OrCmds`, `AndCmds`, `ErrOrCmds`. I’m more than happy to learn. That’s not the issue. I just don’t need them right now for my usage case. Also, with my quick search for `AndCmds` not pulling up anything useful or explanatory, it looks like learning about these types will take some care and effort to really do it right.

And then there’s the matter of what is more “Julian.” Again, since I’m new to the language and community, I don’t feel like I’m a great person to say “this is how you should use it” since my experience with `spawn` has been limited to only what was shown in the Github answer.

I fully understand people are busy and that most programmers dislike documentation. That’s to be expected. The point of this was just that I found something that looked very useful but I don’t know how to use it and instead of requesting some help for my personal use case, I thought others could benefit if there was some more documentation.

… so there’s my excuse, haha. I certainly don’t intend to be rude.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [July 10, 2017, 7:15pm UTC](https://discourse.julialang.org/t/spawn-documentation-update-request/4668/5 "2017-07-10T19:15:24Z")

</div>

No problem! It’s not wrong to ask for documentation, it’s just that there’s a pretty small set of people who could provide that documentation (I’m not one of them, for example), and most of them are volunteers and are already way too busy. So the chances of it happening are definitely nonzero but might be low.

On the other hand, there’s probably a corollary of [Cunningham’s Law](https://meta.wikimedia.org/wiki/Cunningham%27s_Law) which goes something like “the best way to fix the documentation is to open a PR with a partial fix” 😉 Opening a PR and having someone correct you may end up being much more effective than asking for a complete right answer from the start.

But I understand that this isn’t your problem, so the above is just my general opinion.
