'Notifies (pushes) all application services interested in this event.
Pushing is done asynchronously, so this method won\'t block for any
prolonged length of time.
Args:
current_id(int): The current maximum ID.'

@defer.inlineCallbacks
def notify_interested_services(self, current_id):

    services = self.store.get_app_services()
    if ((not services) or (not self.notify_appservices)):
        return
    self.current_max = max(self.current_max, current_id)
    if self.is_processing:
        return
    with Measure(self.clock, 'notify_interested_services'):
        self.is_processing = True
        try:
            upper_bound = self.current_max
            limit = 100
            while True:
                (upper_bound, events) = (yield self.store.get_new_events_for_appservice(upper_bound, limit))
                if (not events):
                    break
                for event in events:
                    services = (yield self._get_services_for_event(event))
                    if (len(services) == 0):
                        continue
                    (yield self._check_user_exists(event.sender))
                    if (event.type == EventTypes.Member):
                        (yield self._check_user_exists(event.state_key))
                    if (not self.started_scheduler):
                        self.scheduler.start().addErrback(log_failure)
                        self.started_scheduler = True
                    for service in services:
                        preserve_fn(self.scheduler.submit_event_for_as)(service, event)
                (yield self.store.set_appservice_last_pos(upper_bound))
                if (len(events) < limit):
                    break
        finally:
            self.is_processing = False
