Named pipes

here is that example using mkfifo, in case it’s helpful:

julia> str = """
           abc
           def
       """
"    abc \n    def\n"

julia> run(`mkfifo my_named_pipe`)
Process(`mkfifo my_named_pipe`, ProcessExited(0))

julia> t1 = Threads.@spawn open("my_named_pipe", "w") do io
           println(io, str)
       end
Task (runnable) @0x000000032063aef0

julia> t2 = Threads.@spawn read(`grep "abc" my_named_pipe`, String)
Task (runnable) @0x000000032063b080

julia> wait.([t1, t2])
2-element Vector{Nothing}:
 nothing
 nothing

julia> fetch(t2)
"    abc \n"

(I know the discussion has moved on to sockets though)

2 Likes