Ejemplo n.º 1
0
class StackItemConfirm(StackItemAsynchronous):
    TYPE = "confirm"
    def __init__(self, confirm, data, type=TYPE):
        StackItemAsynchronous.__init__(self, confirm, data, type)
        self.base = Pause("50") + confirm.base # TODO: fix this race condition
        self.rspec = confirm.rspec
        self.hmc_response = 0
        
    def execute(self, success):
        if self.mutable_integer["value"]==1:
            self.base.execute(self.dragonfly_data)
        self.base = None
        StackItemAsynchronous.execute(self, success)
    
    def shared_state(self, mutable_integer):
        self.mutable_integer = mutable_integer
Ejemplo n.º 2
0
class StackItemConfirm(StackItemAsynchronous):
    TYPE = "confirm"

    def __init__(self, confirm, data, type=TYPE):
        StackItemAsynchronous.__init__(self, confirm, data, type)
        self.base = Pause("50") + confirm.base  # TODO: fix this race condition
        self.rspec = confirm.rspec
        self.hmc_response = 0

    def execute(self, success):
        if self.mutable_integer["value"] == 1:
            self.base.execute(self.dragonfly_data)
        self.base = None
        StackItemAsynchronous.execute(self, success)

    def shared_state(self, mutable_integer):
        self.mutable_integer = mutable_integer
Ejemplo n.º 3
0
class StackItemConfirm(StackItemAsynchronous):
    TYPE = "confirm"
    def __init__(self, confirm, data, type=TYPE):
        StackItemAsynchronous.__init__(self, confirm, data, type)
        self.base = Pause("50") + confirm.base # TODO: fix this race condition
        self.rspec = confirm.rspec
        self.hmc_response = 0
        
    def execute(self, success):
        if self.hmc_response==1:
            self.base.execute(self.dragonfly_data)
        self.base = None
        StackItemAsynchronous.execute(self, success)
        
    def receive_hmc_response(self, data):
        self.hmc_response = data