sabri
October 3, 2017, 3:14pm
1
As I am creating a stream for a file using
File.stream!(path)
what if I started the stream from another node? would the File.stream
reach the node at which the file is stored always? ex: the stream is started from another node that created at…
is this safe?
As long as the File.stream!
is started on the node with the file then you can send the stream messages to other nodes just fine.
sabri
October 4, 2017, 6:30am
3
I create the stream on a node, but I might start it from another node…
Like, on some node:
stream= File.stream!(path)
Agent.start(fn -> %{"stream" => stream} end, name: {:global, :my_stream} )
then, on some node:
stream= Agent.get( {:global, :my_stream}, fn %{"stream" => stream } -> stream end )
Task.start_link(Stream, :run, [stream])
I hope I make it clear now