@profile<EOL><INDENT>def run(self):<DEDENT>
try:<EOL><INDENT>while self.py3_wrapper.running:<EOL><INDENT>event_str = self.poller_inp.readline()<EOL>if not event_str:<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>if event_str[<NUM_LIT:0>] == "<STR_LIT:U+002C>":<EOL><INDENT>event_str = event_str[<NUM_LIT:1>:]<EOL><DEDENT>event = loads(event_str)<EOL>self.dispatch_event(event)<EOL><DEDENT>except Exception:<EOL><INDENT>self.py3_wrapper.report_exception("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>except:  <EOL><INDENT>err = "<STR_LIT>"<EOL>self.py3_wrapper.report_exception(err, notify_user=False)<EOL>self.py3_wrapper.notify_user(err, level="<STR_LIT>")<EOL><DEDENT>
Wait for an i3bar JSON event, then find the right module to dispatch
the message to based on the 'name' and 'instance' of the event.

In case the module does NOT support click_events, the default
implementation is to clear the module's cache
when the MIDDLE button (2) is pressed on it.

Example event:
{'y': 13, 'x': 1737, 'button': 1, 'name': 'empty', 'instance': 'first'}