<commit_before>public
extension Dispatcher
{
    func subscribe(
        _ observer: AnyObject,
        updateNow: Bool = true
        ) -> SubscriptionBlank
    {
        return
            SubscriptionBlank(
                observer: observer,
                dispatcher: self,
                initialUpdate: updateNow)
    }
    
    func unsubscribe(_ observer: AnyObject)
    {
        subscriptions
            .removeObject(forKey: observer)
    }
}

//=== MARK: Internal

extension Dispatcher
{
    func register(_ observer: AnyObject,
                  _ subscription: Subscription,
                  _ initialUpdate: Bool = true)
    {
        subscriptions
            .setObject(subscription, forKey: observer)
        
        //===
        
        if initialUpdate
        {
            notify(subscription)
        }
    }
    
    func notifySubscriptions()
    {
        _ = subscriptions
            .objectEnumerator()?<commit_msg>Made subscription only available via proxy.<commit_after>extension Dispatcher
{
    func subscribe(
        _ observer: AnyObject,
        updateNow: Bool = true
        ) -> SubscriptionBlank
    {
        return
            SubscriptionBlank(
                observer: observer,
                dispatcher: self,
                initialUpdate: updateNow)
    }
    
    func unsubscribe(_ observer: AnyObject)
    {
        subscriptions
            .removeObject(forKey: observer)
    }

    func register(_ observer: AnyObject,
                  _ subscription: Subscription,
                  _ initialUpdate: Bool = true)
    {
        subscriptions
            .setObject(subscription, forKey: observer)
        
        //===
        
        if initialUpdate
        {
            notify(subscription)
        }
    }
    
    func notifySubscriptions()
    {
        _ = subscriptions
            .objectEnumerator()?
{'fraction_non_alphanumeric': 0.07082002129925452, 'fraction_numerical': 0.0, 'mean_word_length': 1.4466145833333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3219428', 'n_tokens_mistral': 476, 'n_tokens_neox': 459, 'n_words': 99}