Exemplo n.º 1
0
def swait(t):
    """Waits `t' ms"""

    final_time = T.time()+t/1000.
    while final_time >= T.time():
	    T.sleep(0.001)
	    micro.micro_block()
Exemplo n.º 2
0
 def sendall(self, data):
     # WARNING: this will busy wait until all data is sent
     # It should be possible to do away with the busy wait with
     # the use of a channel.
     self.sendBuffer += data
     while self.sendBuffer:
         micro_block()
     return len(data)
Exemplo n.º 3
0
def ManageSockets():
    global managerRunning

    while len(asyncore.socket_map):
        # Check the sockets for activity.
        asyncore.poll(0.05)
        # Yield to give other tasklets a chance to be scheduled.
        micro_block()

    managerRunning = False
Exemplo n.º 4
0
def ManageSockets():
    global managerRunning

    while len(asyncore.socket_map):
        # Check the sockets for activity.
        asyncore.poll(0.05)
        # Yield to give other tasklets a chance to be scheduled.
        micro_block()

    managerRunning = False
Exemplo n.º 5
0
 def send(self, data):
     self.sendBuffer += data
     micro_block()
     return len(data)
Exemplo n.º 6
0
 def send(self, data):
     self.sendBuffer += data
     micro_block()
     return len(data)