async def disconnect(
    is_app: bool, listeners: t.Set[t.Tuple[str, Listener]]
) -> None:
    """Disconnect a listener

    Args:
        is_app: whether is an app listener
        listeners: events the listener has subscribed to

    Returns:
        A closed session event or None
    """
    for event_name, listener in listeners:
        get_listeners()[event_name].remove(listener)

    if is_app:
        decrement_app_count()

        if not get_app_count() and focx._get_context() == focx._NONE:
            return await dispatch_event(None, CloseSession())

    return None
Disconnect a listener

    Args:
        is_app: whether is an app listener
        listeners: events the listener has subscribed to

    Returns:
        A closed session event or None
    
fiftyone/server/events/listener.py