コード例 #1
0
class CustomerQueueFactory(protocol.Factory):
    def __init__(self):
        self.q = CustomerQueue()
        pass

    def add_to_queue(self, customer):
        self.q.add_customer(customer)

    def get_from_queue(self):
        return self.q.get_customer()

    def has_customer(self):
        return self.q.has_customer()

    def buildProtocol(self, addr):
        print "Got connection from "+str(addr)
        return CustomerQueueServer(self)
コード例 #2
0
class CustomerQueueFactory(protocol.Factory):
    def __init__(self):
        self.q = CustomerQueue()
        pass

    def add_to_queue(self, customer):
        self.q.add_customer(customer)

    def get_from_queue(self):
        return self.q.get_customer()

    def has_customer(self):
        return self.q.has_customer()

    def buildProtocol(self, addr):
        print "Got connection from " + str(addr)
        return CustomerQueueServer(self)
コード例 #3
0
 def __init__(self):
     self.q = CustomerQueue()
     pass
コード例 #4
0
 def __init__(self):
     self.q = CustomerQueue()
     pass