def run(self):
while True:<EOL><INDENT>try:<EOL><INDENT>cursor = JSON_CLIENT.json_client['<STR_LIT>']['<STR_LIT>'].find(<EOL>{'<STR_LIT>': {'<STR_LIT>': self.last_timestamp}})<EOL><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>cursor.add_option(<NUM_LIT:2>)  <EOL>cursor.add_option(<NUM_LIT:8>)  <EOL>cursor.add_option(<NUM_LIT:32>)  <EOL>self._retry()<EOL>for doc in cursor:<EOL><INDENT>self.last_timestamp = doc['<STR_LIT>']<EOL>if doc['<STR_LIT>'] in self.receivers:<EOL><INDENT>self._run_namespace(doc)<EOL><DEDENT><DEDENT><DEDENT>time.sleep(<NUM_LIT:1>)<EOL><DEDENT>
main control loop for thread