<commit_before>var express = require("express");
var socketio = require('socket.io');
var backlog = require("../");

createApp().listen(3000, function() {
	console.log("http://localhost:3000");
});

function createApp() {
	var app = express();
	var http = require("http").Server(app);
	app.use(express.static(__dirname));

	var io = socketio(http);
	io.adapter(backlog({
		length: 100,
		peremption: 86400
	}));
	io.on("connection", function(socket) {
		console.log('a user connected', socket.id);
		socket.on('join', function(data) {
			console.log('join', data);
			if (data.mtime) socket.joinArgs = data.mtime;
			socket.join(data.room);
			socket.on("message", function(message) {
				console.log(socket.id, 'message', message);
				var now = new Date();
				var completeMessage = {
					text: message,
					mtime: now.getTime()
				};
				io.to(data.room).emit('message', completeMessage);
			});
		});
		socket.on("disconnect", function() {
			console.log("disconnect", socket.id);
		});
	});
	return http;
}<commit_msg>Add cache parameter.<commit_after>var express = require("express");
var socketio = require('socket.io');
var backlog = require("../");

createApp().listen(3000, function() {
	console.log("http://localhost:3000");
});

function createApp() {
	var app = express();
	var http = require("http").Server(app);
	app.use(express.static(__dirname));

	var io = socketio(http);
	io.adapter(backlog({
		length: 100,
		peremption: 86400,
		cacheSize: 2
	}));
	io.on("connection", function(socket) {
		console.log('a user connected', socket.id);
		socket.on('join', function(data) {
			console.log('join', data);
			if (data.mtime) socket.joinArgs = data.mtime;
			socket.join(data.room);
			socket.on("message", function(message) {
				console.log(socket.id, 'message', message);
				var now = new Date();
				var completeMessage = {
					text: message,
					mtime: now.getTime()
				};
				io.to(data.room).emit('message', completeMessage);
			});
		});
		socket.on("disconnect", function() {
			console.log("disconnect", socket.id);
		});
	});
	return http;
}
{'fraction_non_alphanumeric': 0.19325301204819278, 'fraction_numerical': 0.015903614457831325, 'mean_word_length': 4.164179104477612, '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': '453461', 'n_tokens_mistral': 802, 'n_tokens_neox': 688, 'n_words': 138}