1 #!/usr/bin/env -S guile -s
4 (add-to-load-path "..")
6 (use-modules (ice-9 streams))
8 (define stream-add-two (make-stream (lambda (state)
9 (if (> state (* 2 (rpc-worker-process-size)))
11 (cons state (+ state 2))))
12 (rpc-worker-process-id)))
14 (define stream-add-one (make-stream (lambda (state)
15 (if (> state (* 2 (rpc-worker-process-size)))
17 (cons state (+ state 1))))
18 (rpc-worker-process-id)))
22 (define (sum-all return a b)
23 (format #t "a: ~a b: ~a~%" a b)
25 (set! counter (1+ counter))
28 (+ (apply + a) (apply + b))))
32 (format #t "I'm master process. Received ~s ~%"
33 (rpc-stream-map sum-all stream-add-one stream-add-two))