def _mainLoop(self):
    '\n        Run the event processing loop.\n\n        General behavior:\n        - Load plugins from disk - see L{load} method.\n        - Get new events from Shotgun\n        - Loop through events\n        - Loop through each plugin\n        - Loop through each callback\n        - Send the callback an event\n        - Once all callbacks are done in all plugins, save the eventId\n        - Go to the next event\n        - Once all events are processed, wait for the defined fetch interval time and start over.\n\n        Caveats:\n        - If a plugin is deemed "inactive" (an error occured during\n          registration), skip it.\n        - If a callback is deemed "inactive" (an error occured during callback\n          execution), skip it.\n        - Each time through the loop, if the pidFile is gone, stop.\n        '
    self.log.debug('Starting the event processing loop.')
    while self._continue:
        events = self._getNewEvents()
        for event in events:
            for collection in self._pluginCollections:
                collection.process(event)
            self._saveEventIdData()
        if (len(events) < self.config.getMaxEventBatchSize()):
            time.sleep(self._fetch_interval)
        for collection in self._pluginCollections:
            collection.load()
        self._loadEventIdData()
    self.log.debug('Shuting down event processing loop.')
Run the event processing loop.

General behavior:
- Load plugins from disk - see L{load} method.
- Get new events from Shotgun
- Loop through events
- Loop through each plugin
- Loop through each callback
- Send the callback an event
- Once all callbacks are done in all plugins, save the eventId
- Go to the next event
- Once all events are processed, wait for the defined fetch interval time and start over.

Caveats:
- If a plugin is deemed "inactive" (an error occured during
  registration), skip it.
- If a callback is deemed "inactive" (an error occured during callback
  execution), skip it.
- Each time through the loop, if the pidFile is gone, stop.
def _mainLoop(self):
    '\n        Run the event processing loop.\n\n        General behavior:\n        - Load plugins from disk - see L{load} method.\n        - Get new events from Shotgun\n        - Loop through events\n        - Loop through each plugin\n        - Loop through each callback\n        - Send the callback an event\n        - Once all callbacks are done in all plugins, save the eventId\n        - Go to the next event\n        - Once all events are processed, wait for the defined fetch interval time and start over.\n\n        Caveats:\n        - If a plugin is deemed "inactive" (an error occured during\n          registration), skip it.\n        - If a callback is deemed "inactive" (an error occured during callback\n          execution), skip it.\n        - Each time through the loop, if the pidFile is gone, stop.\n        '
    self.log.debug('Starting the event processing loop.')
    while self._continue:
        events = self._getNewEvents()
        for event in events:
            for collection in self._pluginCollections:
                collection.process(event)
            self._saveEventIdData()
        if (len(events) < self.config.getMaxEventBatchSize()):
            time.sleep(self._fetch_interval)
        for collection in self._pluginCollections:
            collection.load()
        self._loadEventIdData()
    self.log.debug('Shuting down event processing loop.')