@@ -0,0 +1,1720 @@
+import ThreadedComponent%0Aimport heapq%0Aimport time%0A%0Aclass SchedulingComponent(ThreadedComponent.threadedcomponent):%0A    Inboxes = %5B%22inbox%22, %22control%22, %22event%22%5D%0A    def __init__(self, **argd):%0A        super(SchedulingComponent, self).__init__(**argd)%0A        self.eventQueue = %5B%5D%0A        %0A    def scheduleRel(self, message, delay, priority=1):%0A        return self.scheduleAbs(message, time.time() + delay, priority) %0A%0A    def scheduleAbs(self, message, eventTime, priority=1):%0A        event = eventTime, priority, message%0A        heapq.heappush(self.eventQueue, event)%0A        return event %0A        %0A    def cancelEvent(self, event):%0A        self.eventQueue.remove(event)%0A        heapq.heapify(self.eventQueue)%0A%0A    def pause(self):%0A        #print %22Pausing%22%0A        if self.eventQueue:%0A            eventTime, priority, message = self.eventQueue%5B0%5D%0A            #print %22Inspecting event:%22, message, eventTime, priority%0A            if time.time() %3C eventTime:%0A                #print %22Event not ready yet, calling wait with timeout%22, eventTime - time.time()%0A                #a = time.time()%0A                self.threadWakeUp.wait(eventTime - time.time())%0A                #print %22wait over, lasted%22, time.time()-a%0A                self.threadWakeUp.clear()%0A                return%0A            else:%0A                #print %22Event ready%22%0A                self.signalEvent()%0A        else:%0A            self.threadWakeUp.wait()%0A            self.threadWakeUp.clear()%0A            %0A    def signalEvent(self):%0A        eventTime, priority, message = heapq.heappop(self.eventQueue)%0A        #print %22Signalling, late by:%22, (time.time() - eventTime)%0A        if not self.inqueues%5B%22event%22%5D.full():%0A            self.inqueues%5B%22event%22%5D.put(message)%0A

Add SchedulingComponent, a component with a built-in event scheduler based upon python's sched module