Beispiel #1
0
def real_work(state):
    actstg = state['activestage']
    stgs = sg.stages(state)
    subqueue = stgs[actstg].form(state)
    frd = state['istream']
    frd.send('enqueue',subqueue)
    return True
Beispiel #2
0
 def init(self,state):
     state['activestage'] = self.active_stage
     cinit = cn.controller.init(self,state)
     abv = state['radio'].above
     g = ct.ctree('monitor')
     state['graph'] = g
     state['stagemap'] = sg.stages(state)
     for sgn in state['stagemap']:
         g.avert(g.root,sgn,state['stagemap'][sgn])
     abv.acmd('testw',test_work,'order test work')
     abv.acmd('report',report,'report work results')
     abv.acmd('stage',set_stage,'set work stage')
     abv.acmd('sinfo',stage_info,'list running stages')
     abv.acmd('work',real_work,'order work to stage')
     abv.acmd('order',order_stage,'order new stage')
     return cinit
Beispiel #3
0
 def init(self,state):
     g = ct.ctree('monitor')
     state['graph'] = g
     state['results'] = []
     state['tearwait'] = True
     state['stagemap'] = sg.stages(state)
     for sgn in state['stagemap']:
         g.avert(g.root,sgn,state['stagemap'][sgn])
     s = state['pinfo']
     cinit = cn.controller.init(self,state)
     abv = state['radio'].above
     abv.schm = 'passive'
     abv.acmd('build',build_network,'')
     abv.acmd('tear',tear_network,'')
     abv.acmd('serverconnect',connect_to_server,'')
     abv.acmd('serverdisconnect',disconnect_from_server,'')
     abv.acmd('order',order_stage,'')
     abv.acmd('sinfo',stage_info,'')
     abv.acmd('enqueue',enqueue,'')
     abv.acmd('report',report,'')
     return cinit