Fork
keepAlive
Commentary
added in 0.10.1
When set to true
, keepAlive
forces new forks to respawn after maxForks
has been reached.
This is useful when you want to cap the total number of forks running, but add new ones after each terminates.
Examples
Setting keepAlive
In this example, two forks will be running at any given time. When a fork exits (by generating 2 messages), a new one will be replaced because keepAlive
is set to true
. If it weren't, ShadowTraffic would exit after each of the two forks generate 2 messages.
[
{
"topic": "sessions",
"fork": {
"key": {
"_gen": "uuid"
},
"maxForks": 2,
"keepAlive": true
},
"value": {
"_gen": "var",
"var": "forkKey"
},
"localConfigs": {
"maxEvents": 2
}
}
]
Specification
JSON schema
{
"type": "boolean"
}