Fork and manage app/group script workers; IPC for buffered + streaming HTTP scripts.
Engine-internal.
- Description:
- Fork and manage app/group script workers; IPC for buffered + streaming HTTP scripts. Engine-internal.
Members
(static) _workers
- Description:
- test helpers
test helpers
(inner, constant) appSnapshots :Map.<string, object>
Type:
- Map.<string, object>
(inner, constant) appWorkerKeys :Map.<string, string>
Type:
- Map.<string, string>
(inner) appsRegistry :object|null
Type:
- object | null
(inner, constant) restartTimers :Map.<string, object>
Type:
- Map.<string, object>
(inner) serverConfig :object|null
Type:
- object | null
(inner) serverLogger :object|null
Type:
- object | null
(inner) webPathResolved :string
Type:
- string
(inner, constant) workers :Map.<string, object>
Type:
- Map.<string, object>
Methods
(inner) buildInitPayload(workerKey, cfg, appNames)
- Description:
- Build multi-app init payload for a worker key.
Parameters:
| Name | Type | Description |
|---|---|---|
workerKey |
string | |
cfg |
object | |
appNames |
Array.<string> |
(async, inner) ensureWorker(app, configopt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
app |
object | ||
config |
object |
<optional> |
(async, inner) executeOnWorker(opts)
- Description:
- Run an HTTP script on the app worker (buffered or streaming).
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
object |
(inner) init(config, logger, webPath, appsopt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
config |
object | ||
logger |
object | ||
webPath |
string | ||
apps |
object |
<optional> |
live apps map for group resolution |
(inner) maybeResetRestarts(handle)
- Description:
- Maybe reset restart count after stable uptime.
Parameters:
| Name | Type | Description |
|---|---|---|
handle |
object |
(inner) onWorkerMessage(handle, msg)
Parameters:
| Name | Type | Description |
|---|---|---|
handle |
object | |
msg |
object |
(inner) readRequestBody(req, maxBytes) → {Promise.<Buffer>}
- Description:
- Read remaining request body into a Buffer.
Parameters:
| Name | Type | Description |
|---|---|---|
req |
object | |
maxBytes |
number |
Returns:
- Type
- Promise.<Buffer>
(inner) rememberApp(app)
- Description:
- Remember app for restarts / group init.
Parameters:
| Name | Type | Description |
|---|---|---|
app |
object |
(inner) scheduleAutoRestart(workerKey, restartsSoFar, memberNames, cfg)
Parameters:
| Name | Type | Description |
|---|---|---|
workerKey |
string | |
restartsSoFar |
number | |
memberNames |
Array.<string> | |
cfg |
object |
(inner) setAppsRegistry(apps)
- Description:
- Update live apps registry (call after initializeApps / reload).
Parameters:
| Name | Type | Description |
|---|---|---|
apps |
object |
(inner) startWorker(app, configopt, optionsopt) → {Promise.<(object|null)>}
- Description:
- Start (or restart) the worker that hosts this app (app-scoped or group).
Parameters:
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
app |
object | ||||||||||
config |
object |
<optional> |
|||||||||
options |
object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<(object|null)>
(inner) stopWorker(appName, optsopt)
- Description:
- Intentional stop (no auto-restart).
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
appName |
string | ||
opts |
object |
<optional> |
(inner) stopWorkerByKey(workerKey, optsopt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
workerKey |
string | ||
opts |
object |
<optional> |