Grid Computing Framework for TypeScript
npm install tgrid




TypeScript Grid Computing Framework.
TypeScript RPC (Remote Procedure Call) framework for WebSocket and Worker protocols.
- WebSocket
- Worker
- SharedWorker
- NestJS
Also, easy to develop complicated network system like grid computing.
``typescript
import { Driver, WebSocketConnector } from "tgrid";
export const webSocketClientMain = async () => {
// CONNECT TO WEBSOCKET SERVER
const connector: WebSocketConnector
new WebSocketConnector(
null, // header
null, // provider for remote server
);
await connector.connect("ws://127.0.0.1:37000/composite");
// CALL REMOTE FUNCTIONS
const remote: Driver
console.log(
await remote.plus(10, 20), // returns 30
await remote.minus(7, 3), // returns 4
await remote.multiply(3, 4), // returns 12
await remote.divide(5, 2), // returns 2.5
);
await connector.close();
};
interface ICalculator {
plus(a: number, b: number): number
minus(a: number, b: number): number
multiply(a: number, b: number): number
divide(a: number, b: number): number
}
`
> `bash`
> $ npm start
> 30 4 12 2.5
>
bash
npm install tgrid
`Just install with
npm command. That's all.If you wanna use
TGrid in NestJS, read Nestia guide documents, too. - TGrid > Guide Documents > Setup
- Nestia > Guide Documents > Setup
- Nestia > Guide Documents > WebSocketRoute
Playground
You can quickly experience TGrid` on the playground websites: - Remote Function Call
- Remote Object Call
- Object Oriented Network
- WebSocket Protocol
- Worker Protocol
- NestJS WebSocket