<commit_before>const io = require('socket.io-client');

var BREACHClient = {
    COMMAND_CONTROL_URL: 'http://localhost:3031/',
    ONE_REQUEST_TIMEOUT: 5000,
    MORE_WORK_TIMEOUT: 10000,
    _socket: null,
    init() {
        this._socket = io.connect(this.COMMAND_CONTROL_URL);
        this._socket.on('connect', () => {
            console.log('Connected');
            this._socket.on('do-work', (work) => {
                console.log('do-work message');
                this.doWork(work);
            });<commit_msg>Make do-work client socket.io event per-socket, not global<commit_after>const io = require('socket.io-client');

var BREACHClient = {
    COMMAND_CONTROL_URL: 'http://localhost:3031/',
    ONE_REQUEST_TIMEOUT: 5000,
    MORE_WORK_TIMEOUT: 10000,
    _socket: null,
    init() {
        this._socket = io.connect(this.COMMAND_CONTROL_URL);
        this._socket.on('connect', () => {
            console.log('Connected');
        });
        this._socket.on('do-work', (work) => {
            console.log('do-work message');
            this.doWork(work);
{'fraction_non_alphanumeric': 0.1541318477251625, 'fraction_numerical': 0.02414113277623027, 'mean_word_length': 2.5344262295081967, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5477238', 'n_tokens_mistral': 359, 'n_tokens_neox': 334, 'n_words': 53}