Softanza
DémarrerEnglish
Softanza
La bibliothèque se documente elle-même · Web et serveur d'applications

stzAppBackend

39 méthodes propres · 4 formes avec extensions, rangées sous leur méthode

la source: base/appserver/stzAppBackend.ring(s'ouvre dans un nouvel onglet) · Toutes les classes · La référence du domaine : Web et serveur d'applications

Sous chaque méthode, ses extensions (Q CS XT Z ZZ IB W U) : en gras et cochée, elle existe ; barrée, elle n'existe pas. Les extensions et leur sens

Aucune méthode de cette classe n'est exécutée sur cette page : la classe touche aux fichiers, au réseau, aux processus, à l'horloge, au hasard ou au son, et un exemple exécuté ici ne serait que l'exemple de ses effets. Chaque méthode porte l'explication que la bibliothèque donne d'elle-même.

Méthode
Explication, telle que la source la porte
init
(sans commentaire dans la source : le nom se lit comme une phrase) initaucune extension
Start
Materialise every dataset of the model as a real sqlite table (seeded with the model's rows), expose each for REST CRUD, and bind the host. nPortNum 0 = ephemeral. After this, the state is LIVE: it no longer lives in the model, it lives in the database the parts share.aucune extension
StartOn
LEAVING THE LOOPBACK REQUIRES A KEY. On 127.0.0.1 the callers are this machine; on a real interface they are whoever can route to the port, and an unauthenticated MBaaS floor would take a POST from any of them. So a non-loopback bind without SetSigningKey() is REFUSED here rather than quietly exposed -- governed by construction, not by a later audit finding.aucune extension
BindHost
The interface this backend is bound to (host mode).aucune extension
Serve
Serve the backend to whoever connects, for nMs. This is what a HOSTING process runs after Start(): the loop that answers remote parts. (A local backend never needs it -- it pumps one event per crossing instead.)aucune extension
ConnectTo
Attach to a backend ALREADY RUNNING somewhere else. No database and no server are created here -- this object becomes a pure client, and every part-scoped call below goes over the wire instead of over the loopback.aucune extension
SetSigningKey
The shared secret that authenticates the crossing. Set it on BOTH sides: the HOST uses it to require a signature, the CLIENT to produce one. It is the same secret, so this one call serves both roles -- which is also why a real deployment must deliver it out of band (env, vault, stzSecretStore), never in the model file or the command line.QCSXTZZZIBWU
IsSigned
(sans commentaire dans la source : le nom se lit comme une phrase) is signeddans la section remote mode: a backend in another hostaucune extension
SetMaxSkew
(sans commentaire dans la source : le nom se lit comme une phrase) set max skewdans la section remote mode: a backend in another hostQCSXTZZZIBWU
LastStatus
The HTTP status of the last crossing, either mode (0 = it never completed). 401 here means the far side refused the signature.aucune extension
IsRemote
(sans commentaire dans la source : le nom se lit comme une phrase) is remotedans la section remote mode: a backend in another hostaucune extension
Endpoint
(sans commentaire dans la source : le nom se lit comme une phrase) endpointdans la section remote mode: a backend in another hostaucune extension
IsReachable
Is the far backend actually answering? (stzAppServer serves /health with no route declared, so this needs nothing from the model.)aucune extension
SpawnRemote
Launch this model as a backend PROCESS of its own and return its endpoint. The child gets the serialised model + port + TTL on its command line, and self-terminates when the TTL expires (so a forgotten host cannot outlive the run). The spawning reactor is owned by THIS object, so the child's lifetime is tied to something the caller holds.aucune extension
SpawnRemoteOn
The secret is handed over in the ENVIRONMENT (STZ_BACKEND_SECRET), not in argv -- see _GenerateHostScript.aucune extension
RemoteLaunchCommands
THE SECRET IS NEVER IN THE COMMAND. argv is world-readable in the remote process table, so the launch line only NAMES the environment variable; the value must already be in the remote environment (deploy it from a vault or stzSecretStore out of band). A backend that leaks its own key while starting has authenticated nothing.aucune extension
ExplainRemoteLaunch
A legible account of what a remote launch would do, and what it needs.aucune extension
ReachAt
Point this client at a different address for the SAME backend -- e.g. a host bound to 0.0.0.0 that another machine reaches at a routable IP.QCSXTZZZIBWU
WaitReady
Wait until the spawned host answers /health (it must load stzBase and bind first). Returns TRUE once it does.aucune extension
Stop
(sans commentaire dans la source : le nom se lit comme une phrase) stopdans la section remote mode: a backend in another hostaucune extension
IsLive
(sans commentaire dans la source : le nom se lit comme une phrase) is livedans la section remote mode: a backend in another hostaucune extension
Port
(sans commentaire dans la source : le nom se lit comme une phrase) portdans la section remote mode: a backend in another hostaucune extension
Name
(sans commentaire dans la source : le nom se lit comme une phrase) namedans la section remote mode: a backend in another hostaucune extension
Create
A part WRITES: a real HTTP POST to the running backend, which the MBaaS floor turns into a sqlite INSERT. Returns TRUE on 201. paFields: [ [ "dish", "Couscous" ], [ "qty", 2 ] ]aucune extension
Rows
A part READS: a real HTTP GET. Returns [ [ cell, cell ], ... ].aucune extension
RowCount
the parts' view of the live stateaucune extension
Dashboard
The part's dashboard, computed over LIVE rows fetched from the running backend -- the SAME aggregation the static model runs (stzTable SumCol / MaxColumn: the part's declared :PivotTable), but over state another part may have written a moment ago. Returns [ rows, total, topDish, topRev ].aucune extension
SetActor
Bind the acting actor: cross-part WRITES then require an effectful one (an LLMActor reads the whole solution and commits none of it). Reads are sensing and stay open. Unbound = ungoverned (dev).QCSXTZZZIBWU
IsGoverned
governance + cross-part auditaucune extension
Traffic
[ [ part, verb, dataset, status, durMs ], ... ] -- every crossing, in order, WITH its cost (perf P3): the ledger now answers not just what crossed and how it ended, but what it took.aucune extension
LastMs
The duration of the last crossing (ms, monotonic clock) -- the marshalling cost of one Create/Rows/RowCount, either mode.aucune extension
LastRoundtripMs
governance + cross-part auditaucune extension
MeanCrossingMs
Mean crossing cost over the whole ledger (refusals, at 0 ms, excluded -- they never crossed).aucune extension
TrafficCount
governance + cross-part auditaucune extension
TrafficOf
the crossings a given part madeaucune extension
RefusedCrossings
governance + cross-part auditaucune extension
Explain
a legible account of the live backend (a list of lines, per the plane's Explain() convention).aucune extension
Show
governance + cross-part auditaucune extension
SaveModelTo
Cells carry their TYPE (n/s) rather than being sniffed on the way back in: a price must stay a NUMBER for the revenue maths, and "looks numeric" is exactly how "007" silently becomes 7 -- a defect this library already paid for once in the CSV reader. Fields are percent-escaped .aucune extension