def schedule(self, function, args=(), kwargs={}):
        """Schedules *function* to be run the Pool.

        *args* and *kwargs* will be forwareded to the scheduled function
        respectively as arguments and keyword arguments.

        A *concurrent.futures.Future* object is returned.
        """
        self._check_pool_state()

        future = Future()
        payload = TaskPayload(function, args, kwargs)
        task = Task(next(self._task_counter), future, None, payload)

        self._context.task_queue.put(task)

        return future
def schedule ( self , function , args = ( ) , kwargs = { } ) : self . _check_pool_state ( ) future = Future ( ) payload = TaskPayload ( function , args , kwargs ) task = Task ( next ( self . _task_counter ) , future , None , payload ) self . _context . task_queue . put ( task ) return future
Schedules *function* to be run the Pool.

        *args* and *kwargs* will be forwareded to the scheduled function
        respectively as arguments and keyword arguments.

        A *concurrent.futures.Future* object is returned.