: spawn-one ( work results -- work results )
    2dup [ over chan.receive drop 10 time.sleep-ms 1 i.+ swap chan.send drop drop ] strand.spawn drop
    drop drop
;

: test-diminishing-returns ( -- )
    chan.make   # work
    chan.make   # results

    spawn-one
    spawn-one
    spawn-one
    spawn-one

    10 time.sleep-ms

    over 10 swap chan.send drop
    over 20 swap chan.send drop
    over 30 swap chan.send drop
    over 40 swap chan.send drop

    dup chan.receive drop
    over chan.receive drop i.+
    over chan.receive drop i.+
    over chan.receive drop i.+
    nip nip

    10 time.sleep-ms

    104 test.assert-eq
;
