<commit_before>//
//  FakeMessageReceiver.swift
//  WebSocketTransport
//
//  Created by <NAME> on 03/09/2014.
//  Copyright (c) 2014 CocoaFlow. All rights reserved.
//

import Foundation
import MessageTransfer
import JSONLib

class FakeMessageReceiver: MessageReceiverWorkaround {
    
    typealias Verification = (channel: String, topic: String, payload: JSON) -> Void
    
    private let verify: Verification
    var messageSender: MessageSender?
    
    init(_ verify: Verification = { (channel, topic, payload) in }) {
        self.verify = verify
    }
    
    func receive(channel: String, _ topic: String, _ payload: JSON) {
        self.verify(channel: channel, topic: topic, payload: payload)
    }
}
<commit_msg>Ability to send messages to receiver's sender.<commit_after>//
//  FakeMessageReceiver.swift
//  WebSocketTransport
//
//  Created by <NAME> on 03/09/2014.
//  Copyright (c) 2014 CocoaFlow. All rights reserved.
//

import Foundation
import MessageTransfer
import JSONLib

class FakeMessageReceiver: MessageReceiverWorkaround {
    
    typealias Verification = (channel: String, topic: String, payload: JSON) -> Void
    
    private let verify: Verification
    var messageSender: MessageSender?
    
    init(_ verify: Verification = { (channel, topic, payload) in }) {
        self.verify = verify
    }
    
    func send(channel: String, _ topic: String, _ payload: JSON) {
        if let sender = self.messageSender {
            sender.send(channel, topic, payload)
        }
    }
    
    func receive(channel: String, _ topic: String, _ payload: JSON) {
        self.verify(channel: channel, topic: topic, payload: payload)
    }
}

{'fraction_non_alphanumeric': 0.1006590772917915, 'fraction_numerical': 0.014379868184541641, 'mean_word_length': 2.957345971563981, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '128282', 'n_tokens_mistral': 497, 'n_tokens_neox': 467, 'n_words': 144}