def _getNewEvents(self):
    '\n        Fetch new events from Shotgun.\n\n        @return: Recent events that need to be processed by the engine.\n        @rtype: I{list} of Shotgun event dictionaries.\n        '
    nextEventId = None
    for newId in [coll.getNextUnprocessedEventId() for coll in self._pluginCollections]:
        if ((newId is not None) and ((nextEventId is None) or (newId < nextEventId))):
            nextEventId = newId
    if (nextEventId is not None):
        filters = [['id', 'greater_than', (nextEventId - 1)]]
        fields = ['id', 'event_type', 'attribute_name', 'meta', 'entity', 'user', 'project', 'session_uuid', 'created_at']
        order = [{'column': 'id', 'direction': 'asc'}]
        conn_attempts = 0
        while True:
            try:
                events = self._sg.find('EventLogEntry', filters, fields, order, limit=self.config.getMaxEventBatchSize())
                if events:
                    self.log.debug('Got %d events: %d to %d.', len(events), events[0]['id'], events[(- 1)]['id'])
                return events
            except (sg.ProtocolError, sg.ResponseError, socket.error) as err:
                conn_attempts = self._checkConnectionAttempts(conn_attempts, str(err))
            except Exception as err:
                msg = ('Unknown error: %s' % str(err))
                conn_attempts = self._checkConnectionAttempts(conn_attempts, msg)
    return []
Fetch new events from Shotgun.

@return: Recent events that need to be processed by the engine.
@rtype: I{list} of Shotgun event dictionaries.
def _getNewEvents(self):
    '\n        Fetch new events from Shotgun.\n\n        @return: Recent events that need to be processed by the engine.\n        @rtype: I{list} of Shotgun event dictionaries.\n        '
    nextEventId = None
    for newId in [coll.getNextUnprocessedEventId() for coll in self._pluginCollections]:
        if ((newId is not None) and ((nextEventId is None) or (newId < nextEventId))):
            nextEventId = newId
    if (nextEventId is not None):
        filters = [['id', 'greater_than', (nextEventId - 1)]]
        fields = ['id', 'event_type', 'attribute_name', 'meta', 'entity', 'user', 'project', 'session_uuid', 'created_at']
        order = [{'column': 'id', 'direction': 'asc'}]
        conn_attempts = 0
        while True:
            try:
                events = self._sg.find('EventLogEntry', filters, fields, order, limit=self.config.getMaxEventBatchSize())
                if events:
                    self.log.debug('Got %d events: %d to %d.', len(events), events[0]['id'], events[(- 1)]['id'])
                return events
            except (sg.ProtocolError, sg.ResponseError, socket.error) as err:
                conn_attempts = self._checkConnectionAttempts(conn_attempts, str(err))
            except Exception as err:
                msg = ('Unknown error: %s' % str(err))
                conn_attempts = self._checkConnectionAttempts(conn_attempts, msg)
    return []