<commit_before>"use strict";

// jQluster Transport object
// requires: jquery, jquery.xpath, util.js

if(!jQluster) { var jQluster = {}; }


(function(my, $) {
    var myclass;
    myclass = my.Transport = function(args) {
        var self = this;
        // @params: args.my_remote_id, args.connection_object
        if(!my.defined(args.my_remote_id)) {
            throw "my_remote_id param is mandatory";
        }
        if(!my.defined(args.connection_object)) {
            throw "connection_object param is mandatory";
        }
        self.my_remote_id = args.my_remote_id;
        self.connection_object = args.connection_object;
        self.pending_request_for = {};
        self.signal_callback_for = {};
        
        self.connection_object.onReceive(function(message) { self._onReceive(message); });
        self.connection_object.send({
            message_id: my.uuid(), message_type: "register",
            from: self.my_remote_id, to: null,
            body: { remote_id: self.my_remote_id }
        });
    };
    myclass.prototype = {
        getMyRemoteID: function() { return this.my_remote_id; },
        selectAndGet: function(args) {
            // @params: args.eval_code, args.remote_id<commit_msg>js/transport.js: add TODO comment on node grouping.<commit_after>"use strict";

// jQluster Transport object
// requires: jquery, jquery.xpath, util.js

if(!jQluster) { var jQluster = {}; }


(function(my, $) {
    var myclass;

    // TODO: Design and implement some mechanism for node grouping. In
    // the current implementation, it is possible for multiple nodes
    // to have the same ID. However, in this case there is no way to
    // distinguish individual nodes with that ID. With a proper
    // grouping mechanism, the user would be able to multi-cast a
    // message (e.g. a 'select_and_listen' message) and still
    // distinguish individual node in the group (e.g. the exact node
    // that sends a 'signal' message).
    
    myclass = my.Transport = function(args) {
        var self = this;
        // @params: args.my_remote_id, args.connection_object
        if(!my.defined(args.my_remote_id)) {
            throw "my_remote_id param is mandatory";
        }
        if(!my.defined(args.connection_object)) {
            throw "connection_object param is mandatory";
        }
        self.my_remote_id = args.my_remote_id;
        self.connection_object = args.connection_object;
        self.pending_request_for = {};
        self.signal_callback_for = {};
        
        self.connection_object.onReceive(function(message) { self._onReceive(message); });
        self.connection_object.send({
            message_id: my.uuid(), message_type: "register",
            from: self.my_remote_id, to: null,
            body: { remote_id: self.my_remote_id }
        });
    };
    myclass.prototype = {
        getMyRemoteID: function() { return this.my_remote_id; },
        selectAndGet: function(args) {
            // @params: args.eval_code, args.remote_id
{'fraction_non_alphanumeric': 0.11376451077943615, 'fraction_numerical': 0.0, 'mean_word_length': 2.478662053056517, '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': '604046', 'n_tokens_mistral': 897, 'n_tokens_neox': 882, 'n_words': 211}