added support for auto, main, dirpath for persistence to stack behavior

This commit is contained in:
Samuel M Smith 2014-03-07 09:52:08 -07:00
parent 78c59c5f7b
commit 69f521e7f3
2 changed files with 102 additions and 88 deletions

View File

@ -2,80 +2,82 @@
house master
init .raet.udp.stack.local to eid 1 name "master" host "" port 7530
init .raet.udp.stack.local to eid 1 name "master" host "" port 7530 \
dirpath "raet/test/keep/" main True auto True
framer masterudpstack be active first start
frame start
do raet udp stack per inode ".raet.udp.stack"
exit
do raet udp stack closer per inode ".raet.udp.stack."
frame start
do raet udp stack per inode ".raet.udp.stack"
exit
do raet udp stack closer per inode ".raet.udp.stack."
framer receiver be active first start
frame start
do raet udp stack printer per inode ".raet.udp.stack."
timeout 5
frame start
do raet udp stack printer per inode ".raet.udp.stack."
timeout 5
frame abort
bid stop all
frame abort
bid stop all
house minion1
init .raet.udp.stack.local to eid 0 name "minion1" host "" port 7531
init .raet.udp.stack.local to eid 0 name "minion1" host "" port 7531 \
dirpath "raet/test/keep/" main False auto True
framer minionudpstack be active first start
frame start
do raet udp stack per inode ".raet.udp.stack"
exit
do raet udp stack closer per inode ".raet.udp.stack."
frame start
do raet udp stack per inode ".raet.udp.stack"
exit
do raet udp stack closer per inode ".raet.udp.stack."
framer bootstrap be active first join
frame join
print Joining Minion1...
enter
do raet udp stack joiner per inode ".raet.udp.stack."
recur
do raet udp stack joined per inode ".raet.udp.stack."
frame join
print Joining Minion1...
enter
do raet udp stack joiner per inode ".raet.udp.stack."
recur
do raet udp stack joined per inode ".raet.udp.stack."
go next if joined in .raet.udp.stack.status
go abort if elapsed >= 5
go next if joined in .raet.udp.stack.status
go abort if elapsed >= 5
frame joined
print Joined Minion1
go next
frame joined
print Joined Minion1
go next
frame allow
print Allowing Minion1...
enter
do raet udp stack allower per inode ".raet.udp.stack."
recur
do raet udp stack allowed per inode ".raet.udp.stack."
frame allow
print Allowing Minion1...
enter
do raet udp stack allower per inode ".raet.udp.stack."
recur
do raet udp stack allowed per inode ".raet.udp.stack."
go next if allowed in .raet.udp.stack.status
go abort if elapsed >= 5
go next if allowed in .raet.udp.stack.status
go abort if elapsed >= 5
frame allowed
print Allowed Minion1
go next
frame allowed
print Allowed Minion1
go next
frame message
print Messaging Minion1...
enter
do raet udp stack messenger to contents "Minion 1 Hello" code 15 \
per inode ".raet.udp.stack."
go next
frame message
print Messaging Minion1...
enter
do raet udp stack messenger to contents "Minion 1 Hello" code 15 \
per inode ".raet.udp.stack."
go next
frame idle
print Idling Minion1...
do raet udp stack idled per inode ".raet.udp.stack."
go abort if idled in .raet.udp.stack.status
frame idle
print Idling Minion1...
do raet udp stack idled per inode ".raet.udp.stack."
go abort if idled in .raet.udp.stack.status
frame abort
bid stop all
frame abort
bid stop all
house minion2
@ -83,52 +85,52 @@ init .raet.udp.stack.local to eid 0 name "minion2" host "" port 7532
framer minionudpstack be active first start
frame start
do raet udp stack per inode ".raet.udp.stack"
exit
do raet udp stack closer per inode ".raet.udp.stack."
frame start
do raet udp stack per inode ".raet.udp.stack"
exit
do raet udp stack closer per inode ".raet.udp.stack."
framer bootstrap be active first join
frame join
print Joining Minion2...
enter
do raet udp stack joiner per inode ".raet.udp.stack."
recur
do raet udp stack joined per inode ".raet.udp.stack."
frame join
print Joining Minion2...
enter
do raet udp stack joiner per inode ".raet.udp.stack."
recur
do raet udp stack joined per inode ".raet.udp.stack."
go next if joined in .raet.udp.stack.status
go abort if elapsed >= 5
go next if joined in .raet.udp.stack.status
go abort if elapsed >= 5
frame joined
print Joined Minion2
go next
frame joined
print Joined Minion2
go next
frame allow
print Allowing Minion2...
enter
do raet udp stack allower per inode ".raet.udp.stack."
recur
do raet udp stack allowed per inode ".raet.udp.stack."
frame allow
print Allowing Minion2...
enter
do raet udp stack allower per inode ".raet.udp.stack."
recur
do raet udp stack allowed per inode ".raet.udp.stack."
go next if allowed in .raet.udp.stack.status
go abort if elapsed >= 5
go next if allowed in .raet.udp.stack.status
go abort if elapsed >= 5
frame allowed
print Allowed Minion2
go next
frame allowed
print Allowed Minion2
go next
frame message
print Messaging Minion2...
enter
do raet udp stack messenger to contents "Minion 2 Hello" code 15 \
per inode ".raet.udp.stack."
go next
frame message
print Messaging Minion2...
enter
do raet udp stack messenger to contents "Minion 2 Hello" code 15 \
per inode ".raet.udp.stack."
go next
frame idle
print Idling Minion2...
do raet udp stack idled per inode ".raet.udp.stack."
go abort if idled in .raet.udp.stack.status
frame idle
print Idling Minion2...
do raet udp stack idled per inode ".raet.udp.stack."
go abort if idled in .raet.udp.stack.status
frame abort
bid stop all
frame abort
bid stop all

View File

@ -25,6 +25,8 @@ raet.udp.stack.destination
# pylint: skip-file
# pylint: disable=W0611
import os
# Import Python libs
from collections import deque
try:
@ -57,6 +59,9 @@ class StackUdpRaet(deeding.Deed): # pylint: disable=W0232
txmsgs=odict(ipath='txmsgs', ival=deque()),
rxmsgs=odict(ipath='rxmsgs', ival=deque()),
local=odict(ipath='local', ival=odict( name='master',
dirpath='raet/test/keep',
main=False,
auto=True,
eid=0,
host='0.0.0.0',
port=raeting.RAET_PORT,
@ -69,8 +74,12 @@ class StackUdpRaet(deeding.Deed): # pylint: disable=W0232
'''
sigkey = self.local.data.sigkey
prikey = self.local.data.prikey
ha = (self.local.data.host, self.local.data.port)
name = self.local.data.name
dirpath = os.path.abspath(os.path.join(self.local.data.dirpath, name))
auto = self.local.data.auto
main = self.local.data.main
ha = (self.local.data.host, self.local.data.port)
eid = self.local.data.eid
estate = estating.LocalEstate( eid=eid,
name=name,
@ -83,6 +92,9 @@ class StackUdpRaet(deeding.Deed): # pylint: disable=W0232
self.stack.value = stacking.StackUdp(estate=estate,
store=self.store,
name=name,
auto=auto,
main=main,
dirpath=dirpath,
txMsgs=txMsgs,
rxMsgs=rxMsgs, )