History | View | Annotate | Download (5.3 kB)
workerpool: Change signature of AddTask function to not use *args
By changing it to a normal parameter, which must be a sequence, we canstart using keyword parameters.
Before this patch all arguments to “AddTask(self, *args)” were passed asarguments to the worker's “RunTask” method. Priorities, which should be...
count the number of tasks done in the wp unittest
Currently there's no way to know if something actually gets done.After this check we actually test that the threads do their job.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Workerpool.AddManyTasks: check tasks type
Each task has to be a sequence, or the RunTask call will fail.
WorkerPool.AddManyTasks
Useful if we want to add many tasks at once, without contention with theprevious one we added starting.
workerpool: Make worker ID alphanumeric
Having a proper name instead of just a number makes debuggingeasier.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Ignore log messages in unittests
Replace all xrange() with range()
Add generic worker pool implementation
Reviewed-by: ultrotter