<commit_before>/* eslint-disable no-console */

"use strict";

let ServiceBroker = require("../src/service-broker");

// Create broker
let broker = new ServiceBroker({
	nodeID: "hot-" + process.pid,
	transporter: "amqp://192.168.0.181:5672",
	logger: console,
	//logLevel: "debug",
	hotReload: true
});

broker.start().then(() => {

	/*
	let svc;
	setTimeout(() => {
		console.log("Create math service...");

		// Create a new service after 5s
		svc = broker.createService({
			name: "math",
			actions: {
				add(ctx) {
					return Number(ctx.params.a) + Number(ctx.params.b);
				},
			}
		});

	}, 5000);

	setTimeout(() => {
		console.log("Destroy math service...");

		// Destroy a created service after 10s
		svc = broker.getService("math");
		broker.destroyService(svc);

	}, 10000);
	*/

	broker.loadService("./examples/hot.service.js");
	broker.loadService("./examples/math.service.js");
	broker.loadService("./examples/user.service.js");

	broker.repl();
});<commit_msg>dev example<commit_after>/* eslint-disable no-console */

"use strict";

let ServiceBroker = require("../src/service-broker");

// Create broker
let broker = new ServiceBroker({
	nodeID: "hot-" + process.pid,
	transporter: "amqp://192.168.0.181:5672",
	logger: console,
	//logLevel: "debug",
	hotReload: true
});

broker.start().then(() => {

	/*
	let svc;
	setTimeout(() => {
		console.log("Create math service...");

		// Create a new service after 5s
		svc = broker.createService({
			name: "math",
			actions: {
				add(ctx) {
					return Number(ctx.params.a) + Number(ctx.params.b);
				},
			}
		});

	}, 5000);

	setTimeout(() => {
		console.log("Destroy math service...");

		// Destroy a created service after 10s
		svc = broker.getService("math");
		broker.destroyService(svc);

	}, 10000);
	*/

	broker.loadService("./examples/hot.service.js");
	//broker.loadService("./examples/math.service.js");
	//broker.loadService("./examples/user.service.js");

	broker.repl();
});
{'fraction_non_alphanumeric': 0.20081549439347604, 'fraction_numerical': 0.026503567787971458, 'mean_word_length': 3.401345291479821, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '281548', 'n_tokens_mistral': 802, 'n_tokens_neox': 689, 'n_words': 133}