Connects PULL socket to tcp://localhost:5557
Collects workloads from ventilator via that socket
Connects PUSH socket to tcp://localhost:5558
Sends results to sink via that socket
let main () =
use context = new Context(1)
// Socket to receive messages on
use receiver = context |> Context.pull
Socket.connect receiver "tcp://localhost:5557"
// Socket to send messages to
use sender = context |> Context.push
Socket.connect sender "tcp://localhost:5558"
// Process tasks forever
while true do
let msg = s_recv receiver
// Simple progress indicator for the viewer
printf "%s." msg
// Do the work
sleep (int msg)
// Send results to sink
s_send sender ""