<commit_before>#!/usr/local/bin/node
/* 
 * Needs websocket-server and (eventually) nodestalker, available 
 * from npm.
 */

var beanstalkRetries = 0;

var io = require('socket.io').listen(8081),
    bs = require('nodestalker'),
    bsClient = bs.Client(),
    TUBE = 'socketuri';

var addListeners = function(c) {
    c.addListener('error', function(err) {
        console.log('beanstalk error', err);
    });
    c.addListener('end', function(err) {
        console.log('beanstalk end', err);
    });
    c.addListener('close', function(err) {
        console.log('beanstalk close', err);
        console.log('will retry');
        bsClient = bs.Client();
        addListeners(bsClient);
        doMain();
    });
};

io.sockets.on("connection", function(socket){
    console.log('got connection', socket);
    socket.join('*');
    socket.on('subscribe', function(data) {
        socket.join(data);
        if (data !== '*') {
            socket.leave('*');
        }
    });
    socket.on('unsubscribe', function(data) {<commit_msg>set debug level, remove unused var<commit_after>#!/usr/local/bin/node
/* 
 * Needs websocket-server and (eventually) nodestalker, available 
 * from npm.
 */

var io = require('socket.io').listen(8081),
    bs = require('nodestalker'),
    bsClient = bs.Client(),
    TUBE = 'socketuri';

io.set('log level', 1); 

var addListeners = function(c) {
    c.addListener('error', function(err) {
        console.log('beanstalk error', err);
    });
    c.addListener('end', function(err) {
        console.log('beanstalk end', err);
    });
    c.addListener('close', function(err) {
        console.log('beanstalk close', err);
        console.log('will retry');
        bsClient = bs.Client();
        addListeners(bsClient);
        doMain();
    });
};

io.sockets.on("connection", function(socket){
    console.log('got connection', socket);
    socket.join('*');
    socket.on('subscribe', function(data) {
        socket.join(data);
        if (data !== '*') {
            socket.leave('*');
        }
    });
    socket.on('unsubscribe', function(data) {
{'fraction_non_alphanumeric': 0.18147086914995225, 'fraction_numerical': 0.004775549188156638, 'mean_word_length': 2.858195211786372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1599595', 'n_tokens_mistral': 690, 'n_tokens_neox': 657, 'n_words': 123}