<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run(self):
 """Main service entrypoint."""

    while not self._state.is_terminating:
      self._process_event_queue()
      self._state.maybe_pause()