2.0.10 • Published 2 years ago

@david.uhlir/cluster v2.0.10

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Cluster util for node.js

This utility is for handle run forks of application with specific initializators. It also provides method calling between fork and master provided as promises.

This util is also checking all forks by ping to know their health. If the response is too long it will restart/kill them - depends on configuration

Usage

import { Cluster, MasterHandler } from '@david.uhlir/cluster'

const workers = Cluster.Initialize({
  worker: async () => ({
    sayHello: () => console.log('Hello world PID:', process.pid)
  }),
})

MasterHandler.Initialize(async () => {
  console.log('Initialize PID:', process.pid)
  const handler = await workers.run.worker()
  await handler.call.sayHello()
})

ISC

2.0.10

2 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.6

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago