Julia is great for implementing distributed computing. I was wondering how could it be possible to take a decentralized approach to this distributed computing. Instead of calling workers from a Julia (master) session (for example through
@spawnat), have two “independent” Julia sessions interact with each other and exchange data.
One could for example establish a connection with Sockets:
# Local example using Sockets l = listen(5000) # Port 5000 a = accept(l)
using Sockets c = connect(5000) # Connect to port 5000 (local example, for remote: connect(host, port))
(I’m not sure how to properly implement sockets, would be also grateful for some help)
Then with the socket connection established, exchange data with some kind of Channel/RemoteChannel
# establish connection AB/BA # create channel result_a # pre-processing while statement b = fetch(result_b) a = foo(b) put!(a, result_a) end
# establish connection AB/BA # create channel result_b # pre-processing while statement a = fetch(result_a) b = bar(a) put!(b, result_b) end
Any ideas on how to bind a channel with a socket, or how to implement such decentralized computing?