<commit_before>var Q = require('q');

function createGameEvent(channel, key, data) {
    return {
        channel: channel,
        key: key,
        data: data
    };
}

function wrapWithPromise(callback) {

    return function(gameEvent) {

        var deferred = Q.defer();

        callback(gameEvent, deferred);

        return deferred.promise;

    };

}

module.exports = {

    createGameEvent: createGameEvent,

    wrapWithPromise: wrapWithPromise
    
};<commit_msg>[server] event engine can send events on dedicated sockets<commit_after>var Q = require('q');

function createGameEvent(channel, key, data) {
    return {
        channel: channel,
        key: key,
        data: data
    };
}

function designateEventSocket(gameEvent, socket) {
    gameEvent.socket = socket;
    return gameEvent;
}

function wrapWithPromise(callback) {

    return function(gameEvent, clientSocket) {

        var deferred = Q.defer();

        callback(gameEvent, deferred, clientSocket);

        return deferred.promise;

    };

}

module.exports = {

    createGameEvent: createGameEvent,

    wrapWithPromise: wrapWithPromise,

    designateEventSocket: designateEventSocket
    
};
{'fraction_non_alphanumeric': 0.09873417721518987, 'fraction_numerical': 0.0, 'mean_word_length': 2.901315789473684, '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': '2099029', 'n_tokens_mistral': 354, 'n_tokens_neox': 328, 'n_words': 79}