MCPcopy Create free account
hub / github.com/comnik/declarative-dataflow / open_sockets

Function open_sockets

src/sources/timely_logging.rs:195–202  ·  view source on GitHub ↗

Listens on 127.0.0.1:8000 and opens `source_peers` sockets from the computations we're examining.

(source_peers: usize)

Source from the content-addressed store, hash-verified

193/// Listens on 127.0.0.1:8000 and opens `source_peers` sockets from
194/// the computations we're examining.
195fn open_sockets(source_peers: usize) -> Arc<Mutex<Vec<Option<TcpStream>>>> {
196 let listener = TcpListener::bind("127.0.0.1:8000").unwrap();
197 let sockets = (0..source_peers)
198 .map(|_| Some(listener.incoming().next().unwrap().unwrap()))
199 .collect::<Vec<_>>();
200
201 Arc::new(Mutex::new(sockets))
202}
203
204/// Construct replayers that read data from sockets and can stream it
205/// into timely dataflow.

Callers 1

sourceMethod · 0.85

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected