# Documenter.jl: Running external commands asynchronously in \`@example\` blocks

**URL:** <https://discourse.julialang.org/t/documenter-jl-running-external-commands-asynchronously-in-example-blocks/135085>\
**Category:** General Usage\
**Tags:** documenter\
**Created:** [January 15, 2026, 7:29pm UTC](https://discourse.julialang.org/t/documenter-jl-running-external-commands-asynchronously-in-example-blocks/135085 "2026-01-15T19:29:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![klafyvel](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@klafyvel](https://discourse.julialang.org/u/klafyvel)\
**Post date:** [January 15, 2026, 7:29pm UTC](https://discourse.julialang.org/t/documenter-jl-running-external-commands-asynchronously-in-example-blocks/135085/1 "2026-01-15T19:29:55Z")

</div>

Hello, I am trying to run the following `@example` block in a Documenter page:

```julia
pinocchio = PipeBuffer()
listener = run(`go-sendxmpp -n -p plopiplop -u pinocchio@localhost -l`, devnull, pinocchio, stderr, wait = false)

```

But the Documenter process hangs when generating the example (the last Documenter Debug output is this block). Everything runs smoothly when I just execute the code manually. Are there any limitations on running external programs asynchronously in Documenter?

Thanks!

---

<div class="post-metadata">

**Author:** ![klafyvel](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@klafyvel](https://discourse.julialang.org/u/klafyvel)\
**Post date:** [January 18, 2026, 4:16pm UTC](https://discourse.julialang.org/t/documenter-jl-running-external-commands-asynchronously-in-example-blocks/135085/2 "2026-01-18T16:16:15Z")

</div>

Well, I found the solution! Although it is not entirely clear to me why, using a `pipeline` instead of directly setting the IO through `run` does the trick:

```julia
pinocchio = PipeBuffer()
listener = run(
    pipeline(
        `go-sendxmpp -n -p plopiplop -u pinocchio@localhost -l`,
        stdin = devnull, stdout = pinocchio, stderr = devnull
    ), wait = false
)

```
