Esempio n. 1
0
def eventLoop():
    global loop_running
    global event_errors
    
    while sockets.values():
        # If there are other tasklets scheduled, then use the nonblocking loop,
        # else, use the blocking loop
        if stackless.getruncount() > 2: # main tasklet + this one
            event.loop(True)
        else:
            event.loop(False)
        stackless.schedule()
    loop_running = False
Esempio n. 2
0
def eventLoop():
    global loop_running
    global event_errors

    while sockets.values():
        # If there are other tasklets scheduled, then use the nonblocking loop,
        # else, use the blocking loop
        if stackless.getruncount() > 2:  # main tasklet + this one
            event.loop(True)
        else:
            event.loop(False)
        stackless.schedule()
    loop_running = False
Esempio n. 3
0
		def get_next(self, session):
			event.loop(1) # EVLOOP_ONCE
			#log.info('pmdsniff.get_next: ' + str(self.handler.transactions))
			if self.handler and len(self.handler.transactions):
				#log.info('pmdsniff.get_next: transactions is %d long' % (
				#			len(self.handler.transactions)))
				for t in self.handler.transactions:
					if t['id'] not in session['seentids']:
						if not (t['request'] or t['response']): continue
						#log.debug(t)
						session['seentids'].append(t['id'])
						session['transactions'].append(t)
						return t
			return None
Esempio n. 4
0
 def get_next(self, session):
     event.loop(1)  # EVLOOP_ONCE
     #log.info('pmdsniff.get_next: ' + str(self.handler.transactions))
     if self.handler and len(self.handler.transactions):
         #log.info('pmdsniff.get_next: transactions is %d long' % (
         #			len(self.handler.transactions)))
         for t in self.handler.transactions:
             if t['id'] not in session['seentids']:
                 if not (t['request'] or t['response']): continue
                 #log.debug(t)
                 session['seentids'].append(t['id'])
                 session['transactions'].append(t)
                 return t
     return None
Esempio n. 5
0
def MainLoop():
    while True:
        # Exceptions (if any) in event handlers would propagate to here.
        # Argument: nonblocking: don't block if nothing available.
        event.loop(len(runnable_greenlets) > 1)
        Schedule()
def MainLoop():
  while True:
    # Exceptions (if any) in event handlers would propagate to here.
    # Argument: nonblocking: don't block if nothing available.
    event.loop(len(runnable_greenlets) > 1)
    Schedule()
def MainLoop():
    while True:
        # Exceptions (if any) in event handlers would propagate to here.
        # Argument: nonblocking: don't block if nothing available.
        event.loop(stackless.runcount > 1)
        stackless.schedule()
def MainLoop():
    while True:
        # Exceptions (if any) in event handlers would propagate to here.
        # Argument: nonblocking: don't block if nothing available.
        event.loop(stackless.runcount > 1)
        stackless.schedule()