1.0.6 • Published 4 years ago
distributed-execution v1.0.6
Distributed
Synopsis
This module allows you to distribute tasks to different node processes locally or remotely and handles task (re)scheduling and data replication.
Code Example
Server
import { Server, SocketIOHandlerDriver } from "distributed-execution";
const driver = new SocketIOHandlerDriver(48593, "127.0.0.1", "abc");
const server = new Server(driver);
await server.start();
const testSum = server.session("testSum");
testSum.updateData("base", 8);
console.log(await testSum.queue(15)); // 43
Client
const sic = new SocketIOClient("http://127.0.0.1:48593", "abc");
const shc = new Client(sic, {
testSum: async (q: number, d: {[key: string]: any}) => q + d.base + 20,
});
Motivation
Installation
Tests
npm test
Contributors
If you like to contribute, please create a issue or a pull request. Please execute tests before creating pull requests.
License
MIT