# Raet Test FloScript

house master

init .raet.road.stack.local to name "master" host "" port 7530 \
    basedirpath "/tmp/raet/test/keep/" main True auto True
init .raet.lane.stack.local to name "boss" lane "ash" \
    basedirpath "/tmp/raet/test/lane/keep/"

framer masterudpstack be active first start
    frame start
        do raet road stack per inode ".raet.road.stack"
        exit
            do raet road stack closer per inode ".raet.road.stack."

framer receiver be active first start
    frame start
        do raet road stack printer per inode ".raet.road.stack."
        timeout 5

    frame abort
        bid stop all

framer bossuxdstack be active first start
    frame start
        do raet lane stack per inode ".raet.lane.stack"
        exit
            do raet lane stack closer per inode ".raet.lane.stack."

framer uxdreceiver be active first start
    frame start
        do raet lane stack printer per inode ".raet.road.stack."
        timeout 5

    frame abort
        bid stop me

framer setupuxdyard be active first start
    frame start
        enter
            do raet lane stack yard add to lane "ash"  name "yard1"

    frame send
        enter
            do raet lane stack transmit to stuff "Lord Hello" \
                per inode ".raet.lane.stack."

    frame stop
        bid stop me


house serf

init .raet.lane.stack.local to name "serf" lane "ash" name "yard1" \
    basedirpath "/tmp/raet/test/lane/keep/"

framer serfuxdstack be active first start
    frame start
        do raet lane stack per inode ".raet.lane.stack"
        exit
            do raet lane stack closer per inode ".raet.lane.stack."

framer uxdreceiver be active first start
    frame start
        do raet lane stack printer per inode ".raet.road.stack."
        timeout 5

    frame abort
        bid stop me


framer setupuxdyard be active first start
    frame start
        enter
            do raet lane stack yard add to lane "ash" name "boss"
        timeout 0.5

    frame send
        enter
            do raet lane stack transmit to stuff "Serf Hello" \
                per inode ".raet.lane.stack."

    frame stop
        bid stop me


house minion1

init .raet.road.stack.local to name "minion1" host "" port 7531 \
    basedirpath "/tmp/raet/test/keep/"


framer minionudpstack be active first start
    frame start
        do raet road stack per inode ".raet.road.stack"
        exit
            do raet road stack closer per inode ".raet.road.stack."

framer bootstrap be active first join
    frame join
        print Joining Minion1...
        enter
            do raet road stack joiner per inode ".raet.road.stack."
        recur
            do raet road stack joined per inode ".raet.road.stack."

    go next if joined in .raet.road.stack.status
    go abort if elapsed >= 5

    frame joined
        print Joined Minion1
        go next

    frame allow
        print Allowing Minion1...
        enter
            do raet road stack allower per inode ".raet.road.stack."
        recur
            do raet road stack allowed per inode ".raet.road.stack."

    go next if allowed in .raet.road.stack.status
    go abort if elapsed >= 5


    frame allowed
        print Allowed Minion1
        go next

    frame message
        print Messaging Minion1...
        enter
            do raet road stack messenger to contents "Minion 1 Hello" code 15 \
                per inode ".raet.road.stack."
        go next

    frame idle
        print Idling Minion1...
        do raet road stack idled per inode ".raet.road.stack."
        go abort if idled in .raet.road.stack.status

    frame abort
        bid stop all

