A high-performance, scalable RPC worker pool service implementing the Actor Model for distributed task processing.
The RPC Worker Pool provides a way to distribute computational tasks across multiple worker threads, improving performance and resource utilization. It supports multiple load balancing strategies and provides a JSON-RPC 2.0 compatible interface.
- Multiple worker threads for parallel task processing
- Several load balancing strategies (round-robin, random, least-busy)
- JSON-RPC 2.0 compatible API
- HTTP and TCP interfaces
- Type-safe implementations with TypeScript
This package is part of the monorepo-one repository. To use it:
# From the monorepo root
# IMPORTANT: Always use Rush commands within monorepo-one
rush update
rush build
IMPORTANT: Package Manager Policy
- Inside monorepo-one: Use ONLY Rush commands (rush add -m -p, rush update)
- Outside monorepo-one: Use ONLY pnpm/pnpx commands (pnpm add, pnpx)
- NEVER use npm, yarn, or npx anywhere
- NEVER use pnpm directly inside monorepo-one when a rush command exists for the same purpose
rushx server <http-endpoint:port> <actor-endpoint:port> <threads> <strategy>
Example:
rushx server 0.0.0.0:8010 0.0.0.0:7010 4 roundrobin
You can make HTTP requests to the server:
curl "http://localhost:8010/helloWorld/World"
Or use the provided client:
rushx ts-node src/base/client.ts localhost 8010 helloWorld World
helloWorld
: Returns a greeting messageecho
: Returns the parameters it receivedstatus
: Returns the server's operational statusinfo
: Returns information about the server
This service implements the Actor Model pattern where actors communicate through message passing. See architecture.md for more details.
rushx server
: Start the serverrushx client
: Run the test clientrushx test:commands
: Run tests for all available commands
MIT