algebra.recovery
This function gives the recovery from a stall. A backoff timer continues to fire through a stall, and what each firing sends gets through only after the stall ends. Thus the connection moves again at the first firing at the end or after it. That firing can be most of a wait after the end. A stall that stops immediately after one firing costs almost all of the next, longer wait.
CLI- Package
- @procedures/algebra · README
- Path
["algebra","recovery"]- CLI
mark algebra recovery --doc <object> --timer <string> --values <object> --stall <object | object>- As data
{"$proc":["algebra","recovery"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/algebra/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["algebra","recovery"], { doc: {}, timer: "<timer>", values: {}, stall: "<stall>" });
console.log(JSON.stringify(result));From the command line
$ mark algebra recovery --doc <object> --timer <string> --values <object> --stall <object | object>
As data, in a program
{
"$proc": ["algebra", "recovery"],
"input": {
"doc": {},
"timer": "<timer>",
"values": {},
"stall": "<stall>"
}
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
doc | object | yes | ||
timer | string | yes | ||
values | object | yes | One call of a pure procedure, as data, for the function KnobValues. It reads each parameter as {"$ref": "<name>"}: name. | |
stall | object | object | yes |
Output
The schema does not list fields (object | object).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"doc": {
"type": "object",
"properties": {
"format": {
"type": "string",
"const": "mark1russell7.machine/1"
},
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"layer": {
"type": "string",
"enum": [
"canary",
"driver",
"injector",
"kernel",
"middlebox",
"proxy",
"self",
"server",
"wire"
]
},
"version": {
"type": "string"
},
"conditions": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "string"
}
},
"sources": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ref": {
"type": "string"
},
"rung": {
"type": "string",
"enum": [
"derived",
"documented",
"implemented",
"normative",
"observed"
]
},
"note": {
"type": "string"
}
},
"required": [
"ref",
"rung"
],
"additionalProperties": {}
}
},
"states": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "object",
"properties": {
"initial": {
"type": "boolean"
},
"final": {
"type": "boolean"
},
"pseudo": {
"type": "boolean"
},
"note": {
"type": "string"
}
},
"additionalProperties": {}
}
},
"events": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"app",
"local",
"packet",
"peer",
"rx",
"timer",
"tx"
]
},
"note": {
"type": "string"
}
},
"required": [
"kind"
],
"additionalProperties": {}
}
},
"knobs": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"scope": {
"type": "string"
},
"unit": {
"type": [
"null",
"string"
]
},
"default": {
"type": [
"null",
"number"
]
},
"off": {
"type": "number",
"description": "This value turns the knob's timers off: a time that reads the knob at it has no bound."
},
"note": {
"type": "string"
}
},
"required": [
"key",
"scope",
"unit",
"default"
],
"additionalProperties": {}
}
},
"timers": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "object",
"properties": {
"duration": {
"anyOf": [
{
"type": "object",
"properties": {
"const": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"const",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"expr": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"expr",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"knob": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"knob",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"model": {
"type": "string"
},
"knobs": {
"type": "array",
"items": {
"type": "string"
}
},
"unit": {
"type": "string"
}
},
"required": [
"model",
"knobs",
"unit"
],
"additionalProperties": {}
}
]
},
"lateness": {
"anyOf": [
{
"type": "object",
"properties": {
"const": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"const",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"expr": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"expr",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"knob": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"knob",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"model": {
"type": "string"
},
"knobs": {
"type": "array",
"items": {
"type": "string"
}
},
"unit": {
"type": "string"
}
},
"required": [
"model",
"knobs",
"unit"
],
"additionalProperties": {}
}
]
},
"early": {
"anyOf": [
{
"type": "object",
"properties": {
"const": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"const",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"expr": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"expr",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"knob": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"knob",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"model": {
"type": "string"
},
"knobs": {
"type": "array",
"items": {
"type": "string"
}
},
"unit": {
"type": "string"
}
},
"required": [
"model",
"knobs",
"unit"
],
"additionalProperties": {}
}
]
},
"arms": {
"type": "array",
"items": {
"type": "string"
}
},
"cancels": {
"type": "array",
"items": {
"type": "string"
}
},
"fires": {
"type": "string"
},
"backoff": {
"type": "object",
"properties": {
"resets": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"resets"
],
"additionalProperties": {},
"description": "A backoff timer starts again after it fires, and no wait is shorter than the wait before it. Examples are the retransmission timer of the kernel, its SYN timer and the reconnect of a driver. Its duration, lateness and early bound are those of one wait. They can read `fired`: the number of times that it fired after the last of its `resets`."
},
"note": {
"type": "string"
}
},
"required": [
"duration",
"arms",
"fires"
],
"additionalProperties": {}
}
},
"realizes": {
"type": "object",
"properties": {},
"additionalProperties": {
"anyOf": [
{
"type": "object",
"properties": {
"duration": {
"anyOf": [
{
"type": "object",
"properties": {
"const": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"const",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"expr": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"expr",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"knob": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"knob",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"model": {
"type": "string"
},
"knobs": {
"type": "array",
"items": {
"type": "string"
}
},
"unit": {
"type": "string"
}
},
"required": [
"model",
"knobs",
"unit"
],
"additionalProperties": {}
}
]
},
"lateness": {
"anyOf": [
{
"type": "object",
"properties": {
"const": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"const",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"expr": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"expr",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"knob": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"knob",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"model": {
"type": "string"
},
"knobs": {
"type": "array",
"items": {
"type": "string"
}
},
"unit": {
"type": "string"
}
},
"required": [
"model",
"knobs",
"unit"
],
"additionalProperties": {}
}
]
},
"early": {
"anyOf": [
{
"type": "object",
"properties": {
"const": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"const",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"expr": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"expr",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"knob": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"knob",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"model": {
"type": "string"
},
"knobs": {
"type": "array",
"items": {
"type": "string"
}
},
"unit": {
"type": "string"
}
},
"required": [
"model",
"knobs",
"unit"
],
"additionalProperties": {}
}
]
},
"note": {
"type": "string"
}
},
"required": [
"duration"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"timer": {
"type": "string"
}
},
"required": [
"timer"
],
"additionalProperties": {}
}
]
},
"description": "These are the mechanisms whose time this machine gives, by the identifier of each mechanism."
},
"over": {
"type": "object",
"properties": {
"machine": {
"type": "string",
"description": "This identifier is the machine below, as a graph identifies its document."
},
"states": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "string"
},
"description": "This map gives the state of the lower machine that each state of this machine is on."
},
"sets": {
"type": "object",
"properties": {},
"additionalProperties": {
"anyOf": [
{
"type": "object",
"properties": {
"const": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"const",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"expr": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"expr",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"knob": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"knob",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"model": {
"type": "string"
},
"knobs": {
"type": "array",
"items": {
"type": "string"
}
},
"unit": {
"type": "string"
}
},
"required": [
"model",
"knobs",
"unit"
],
"additionalProperties": {}
}
]
},
"description": "These are the knobs of the lower machine that this machine sets, by their lower names, over its own knobs."
},
"ends": {
"type": "string",
"description": "This event is the event of this machine that the end of the lower machine arrives as."
},
"note": {
"type": "string"
}
},
"required": [
"machine",
"states",
"sets",
"ends"
],
"additionalProperties": {},
"description": "This is the machine that this machine operates on, for a machine on another machine."
},
"transitions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"from": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"to": {
"type": "string"
},
"on": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"guard": {
"type": "string"
},
"timer": {
"type": "string"
},
"emits": {
"type": "array",
"items": {
"type": "string"
}
},
"errno": {
"type": "string"
},
"note": {
"type": "string"
},
"source": {
"type": "string"
}
},
"required": [
"id",
"from",
"to",
"on"
],
"additionalProperties": {}
}
},
"observe": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "object",
"properties": {
"states": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "string"
}
},
"hides": {
"type": "array",
"items": {
"type": "string"
}
},
"fidelity": {
"type": "string",
"enum": [
"complete",
"derived",
"lossy",
"sampled"
]
},
"note": {
"type": "string"
}
},
"required": [
"states",
"fidelity"
],
"additionalProperties": {}
}
},
"generated": {
"type": "object",
"properties": {
"from": {
"type": "string"
},
"by": {
"type": "string"
}
},
"required": [
"from",
"by"
],
"additionalProperties": {}
}
},
"required": [
"format",
"id",
"title",
"layer",
"version",
"sources",
"states",
"events",
"knobs",
"timers",
"transitions"
],
"additionalProperties": {}
},
"timer": {
"type": "string"
},
"values": {
"type": "object",
"properties": {
"$proc": {
"minItems": 1,
"type": "array",
"items": {
"type": "string"
}
},
"input": {},
"$when": {
"type": "string",
"const": "$never"
}
},
"required": [
"$proc"
],
"additionalProperties": {},
"x-procedures-program": {
"params": [
"name"
],
"inputs": [
{
"type": "string"
}
],
"output": {
"anyOf": [
{
"$ref": "#/$defs/Quantity"
},
{
"$ref": "#/$defs/Unbounded"
},
{
"$ref": "#/$defs/Unknown"
}
]
},
"undefinedForNull": true
},
"description": "One call of a pure procedure, as data, for the function KnobValues. It reads each parameter as {\"$ref\": \"<name>\"}: name."
},
"stall": {
"anyOf": [
{
"type": "object",
"properties": {
"value": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"value",
"unit"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"value": {
"type": "string",
"const": "infinite"
},
"unit": {
"type": "string"
}
},
"required": [
"value",
"unit"
],
"additionalProperties": {}
}
]
}
},
"required": [
"doc",
"timer",
"values",
"stall"
],
"additionalProperties": false
},
"output": {
"anyOf": [
{
"type": "object",
"properties": {
"firings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fired": {
"type": "number"
},
"low": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"value",
"unit"
],
"additionalProperties": {},
"description": "This time is the sum of the waits to this firing, each less how early it can fire."
},
"high": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"value",
"unit"
],
"additionalProperties": {},
"description": "This time is the sum of the waits to this firing, each plus how late it can fire."
}
},
"required": [
"fired",
"low",
"high"
],
"additionalProperties": {}
},
"description": "These are its firings from its arming, up to the first one that surely comes after the end of the stall."
},
"first": {
"type": "array",
"items": {
"type": "number"
},
"description": "These are the firings that can be the first after the end of the stall. There is more than one when the end falls in the bounds of a firing: that firing can come before the end or after it."
},
"low": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"value",
"unit"
],
"additionalProperties": {},
"description": "This time is the earliest time of the first firing after the end of the stall, from the arming."
},
"high": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"unit": {
"type": "string"
}
},
"required": [
"value",
"unit"
],
"additionalProperties": {},
"description": "This time is the latest time of that firing, from the arming."
}
},
"required": [
"firings",
"first",
"low",
"high"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"unknown": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"unknown"
],
"additionalProperties": {}
}
]
}
}