Skip to content

Instantly share code, notes, and snippets.

@ericphanson
Last active October 13, 2023 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericphanson/b411a090bb46c89335a71bf808f8db13 to your computer and use it in GitHub Desktop.
Save ericphanson/b411a090bb46c89335a71bf808f8db13 to your computer and use it in GitHub Desktop.
Basic IPC with named pipes
julia> include("consumer.jl");
Python started
Python done
Julia done: got hello world
pipe = "py_to_julia"
ispath(pipe) && rm(pipe)
run(`mkfifo $pipe`)
@sync begin
@async run(`python producer.py`)
@async begin
x = read(pipe, String)
print("Julia done: got $x")
end
end
print("Python started")
with open('py_to_julia', 'w') as f:
f.write('hello world')
print("Python done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment