try:
results.put(callable(*args, **kwds))
except Exception, e:
- logger.log_exc('ThreadManager: Error in thread: ')
+ logger.log_exc('MultiClient: Error in thread: ')
errors.put(traceback.format_exc())
thread = ThreadInstance()
-class ThreadManager:
+class MultiClient:
"""
- ThreadManager executes a callable in a thread and stores the result
- in a thread safe queue.
+ MultiClient allows to issue several SFA calls in parallel in different threads
+ and stores the results in a thread safe queue.
"""
def __init__(self):
"""
Return a list of all the results so far. Blocks until
all threads are finished.
- If lienent is set to false the error queue will be checked before
+ If lenient is set to false the error queue will be checked before
the response is returned. If there are errors in the queue an SFA Fault will
be raised.
"""
time.sleep(sleep)
return nums
- threads = ThreadManager()
+ threads = MultiClient()
threads.run(f, "Thread1", 10, 2)
threads.run(f, "Thread2", -10, 1)
threads.run(e, "Thread3", 19, 1)