async def _start_pusher(self, pusher_config: PusherConfig) -> Optional[Pusher]:
    'Start the given pusher\n\n        Args:\n            pusher_config: The pusher configuration with the values pulled from the db table\n\n        Returns:\n            The newly created pusher or None.\n        '
    if (not self._pusher_shard_config.should_handle(self._instance_name, pusher_config.user_name)):
        return None
    try:
        p = self.pusher_factory.create_pusher(pusher_config)
    except PusherConfigException as e:
        logger.warning('Pusher incorrectly configured id=%i, user=%s, appid=%s, pushkey=%s: %s', pusher_config.id, pusher_config.user_name, pusher_config.app_id, pusher_config.pushkey, e)
        return None
    except Exception:
        logger.exception("Couldn't start pusher id %i: caught Exception", pusher_config.id)
        return None
    if (not p):
        return None
    appid_pushkey = ('%s:%s' % (pusher_config.app_id, pusher_config.pushkey))
    byuser = self.pushers.setdefault(pusher_config.user_name, {})
    if (appid_pushkey in byuser):
        byuser[appid_pushkey].on_stop()
    byuser[appid_pushkey] = p
    synapse_pushers.labels(type(p).__name__, p.app_id).inc()
    user_id = pusher_config.user_name
    last_stream_ordering = pusher_config.last_stream_ordering
    if last_stream_ordering:
        have_notifs = (await self.store.get_if_maybe_push_in_range_for_user(user_id, last_stream_ordering))
    else:
        have_notifs = True
    p.on_started(have_notifs)
    return p
Start the given pusher

Args:
    pusher_config: The pusher configuration with the values pulled from the db table

Returns:
    The newly created pusher or None.
async def _start_pusher(self, pusher_config: PusherConfig) -> Optional[Pusher]:
    'Start the given pusher\n\n        Args:\n            pusher_config: The pusher configuration with the values pulled from the db table\n\n        Returns:\n            The newly created pusher or None.\n        '
    if (not self._pusher_shard_config.should_handle(self._instance_name, pusher_config.user_name)):
        return None
    try:
        p = self.pusher_factory.create_pusher(pusher_config)
    except PusherConfigException as e:
        logger.warning('Pusher incorrectly configured id=%i, user=%s, appid=%s, pushkey=%s: %s', pusher_config.id, pusher_config.user_name, pusher_config.app_id, pusher_config.pushkey, e)
        return None
    except Exception:
        logger.exception("Couldn't start pusher id %i: caught Exception", pusher_config.id)
        return None
    if (not p):
        return None
    appid_pushkey = ('%s:%s' % (pusher_config.app_id, pusher_config.pushkey))
    byuser = self.pushers.setdefault(pusher_config.user_name, {})
    if (appid_pushkey in byuser):
        byuser[appid_pushkey].on_stop()
    byuser[appid_pushkey] = p
    synapse_pushers.labels(type(p).__name__, p.app_id).inc()
    user_id = pusher_config.user_name
    last_stream_ordering = pusher_config.last_stream_ordering
    if last_stream_ordering:
        have_notifs = (await self.store.get_if_maybe_push_in_range_for_user(user_id, last_stream_ordering))
    else:
        have_notifs = True
    p.on_started(have_notifs)
    return p