1 '''A non-concurrent implementation of the papyros master-slave API.
2
3 This is mainly for the sake of completeness and perhaps as a fallback in systems
4 that the concurrent implementations are not available.
5 '''
6
7 __all__ = ['SingleThreadedMaster']
8
9 from papyros import Master, Slave
10
12
13 - def __init__(self, poll_time=1, request_qsize=0, response_qsize=0):
16
18 if timeout > 0:
19 raise ValueError('Cannot guarantee non-zero timeout in single-threaded mode')
20 if timeout is None:
21 self.process()
22 return Master.popProcessedJob(self,timeout)
23