def _schedule(self, action: Callable, seconds: int=0) -> int:
        """
        Schedule an action to be executed after `seconds` seconds.

        :param action: a callable to be scheduled
        :param seconds: the time in seconds after which the action must be executed
        """
        self.aid += 1
        if seconds > 0:
            nxt = time.perf_counter() + seconds
            if nxt < self.aqNextCheck:
                self.aqNextCheck = nxt
            logger.trace("{} scheduling action {} with id {} to run in {} "
                         "seconds".format(self, get_func_name(action),
                                          self.aid, seconds))
            self.aqStash.append((nxt, (action, self.aid)))
        else:
            logger.trace("{} scheduling action {} with id {} to run now".
                         format(self, get_func_name(action), self.aid))
            self.actionQueue.append((action, self.aid))

        if action not in self.scheduled:
            self.scheduled[action] = []
        self.scheduled[action].append(self.aid)

        return self.aid
def _schedule ( self , action : Callable , seconds : int = 0 ) -> int : self . aid += 1 if seconds > 0 : nxt = time . perf_counter ( ) + seconds if nxt < self . aqNextCheck : self . aqNextCheck = nxt logger . trace ( "{} scheduling action {} with id {} to run in {} " "seconds" . format ( self , get_func_name ( action ) , self . aid , seconds ) ) self . aqStash . append ( ( nxt , ( action , self . aid ) ) ) else : logger . trace ( "{} scheduling action {} with id {} to run now" . format ( self , get_func_name ( action ) , self . aid ) ) self . actionQueue . append ( ( action , self . aid ) ) if action not in self . scheduled : self . scheduled [ action ] = [ ] self . scheduled [ action ] . append ( self . aid ) return self . aid
Schedule an action to be executed after `seconds` seconds.

        :param action: a callable to be scheduled
        :param seconds: the time in seconds after which the action must be executed