def eventloop(self, *args, **kwargs):
<EOL>status = None<EOL>start = time.time()<EOL>first_loop = True<EOL>while not self.exit.is_set():<EOL><INDENT>if first_loop:<EOL><INDENT>first_loop = False<EOL>self.started.set()<EOL><DEDENT>now = time.time()<EOL>timedelta = now - start<EOL>start = now<EOL>if self._target:<EOL><INDENT>kwargs['<STR_LIT>'] = timedelta<EOL>logging.debug(<EOL>"<STR_LIT>".format(<EOL>**locals()))<EOL>status = self._target(*args, **kwargs)<EOL><DEDENT>if status is not None:<EOL><INDENT>break<EOL><DEDENT><DEDENT>if self.started.is_set() and status is None and self.exit.is_set():<EOL><INDENT>status = <NUM_LIT:0><EOL><DEDENT>return status<EOL>
Hand crafted event loop, with only one event possible : exit
More events ( and signals ) can be added later, after converting to asyncio.