La bibliothèque se documente elle-même · Web et serveur d'applications
stzAppServer
61 méthodes propres · 7 formes avec extensions, rangées sous leur méthode
la source: base/appserver/stzAppServer.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
Bind the HTTP listener. nPortNum 0 = ephemeral (see Port()). Raises on bind failure -- no silent half-started server.aucune extension
StartTls
Serve over TLS: the reactor terminates TLS per connection (server cert cCertPath + key cKeyPath) BELOW the router, so every handler runs on the DECRYPTED request and responses are encrypted transparently -- the routing/handler code is byte-for-byte identical to plain Start(). A non-empty cCaPath enables client-cert checks; bRequireClient = TRUE demands a valid client cert (mutual TLS). Same bind semantics as Start.aucune extension
StartHttps
One-way HTTPS convenience (server cert only, no client cert).aucune extension
Stop
server lifecycleaucune extension
IsRunning
server lifecycleaucune extension
Port
server lifecycleaucune extension
Host
server lifecycleaucune extension
Uptime
server lifecycleaucune extension
RequestCount
server lifecycleaucune extension
ReactorQ
The underlying reactor as a chainable stz object (Q-convention).aucune extension
ServeOne
Drain events until ONE data event (an HTTP request or a raw chunk) has been handled, or nTimeoutMs elapses. Returns TRUE if work was done. Accept/closed events are drained silently along the way.aucune extension
RunFor
With agents hosted, the serve slice is BOUNDED: ServeOne(nLeft) would otherwise park on the socket for the whole remaining time whenever no request arrives, and the agents -- which live on this same loop -- would never tick. So we serve for at most @nAgentSliceMs, then tick whatever is due, and repeat. Requests and perceive-decide-act interleave on ONE loop.aucune extension
Run
Serve forever (until the process is killed or Stop() is called from a handler). The documented blocking entry point.aucune extension
Get_
routing interfaceaucune extension
Post
routing interfaceaucune extension
Put_
routing interfaceaucune extension
Delete
routing interfaceaucune extension
Observe
Observe this server with a perf monitor (perf P3). From this call on, every request records its response time R into the timer 'http.request.ms', its arrival into the counter 'http.requests' (throughput X = its measured rate), and 5xx outcomes into 'http.errors'; GET /metrics serves the monitor's Prometheus exposition, and /health widens with the process senses. The monitor's watched senses (memory/cpu) are ticked by the serve loop at the monitor's own cadence -- a served app samples itself.aucune extension
IsObserved
routing interfaceaucune extension
ObserveRoutes
Per-route observation (perf P8): Observe() PLUS a timer FAMILY 'http.route.ms' labeled [method, route, class] -- one child per route the traffic actually exercises, each with its own percentiles ('class' is the status class: 2xx/4xx/5xx). Cardinality rides the family's bound: unruly path spaces land in the overflow child instead of exploding the registry.aucune extension
Use
routing interfaceaucune extension
Static
routing interfaceaucune extension
Expose
Expose a table of an open stzDatabase as a REST resource -- the FULL CRUD floor, keyed by the "id" column (override with ExposeWithKey): GET /api/<table> -> {"rows":[[...],...]} (list) GET /api/<table>/count -> {"count":N} GET /api/<table>/<id> -> {"row":[...]} or 404 (read one) POST /api/<table> -> body "col=val&.." inserts; 201 PUT /api/<table>/<id> -> body "col=val&.." updates; {"updated":N} DELETE /api/<table>/<id> -> {"deleted":N} Values + the id are SQL-escaped (injection-safe).aucune extension
ExposeWithKey
Same, but with a custom primary-key column (e.g. "uuid", "rowid").aucune extension
RequireSignedRequests
NOTE (Haro aliasing): the stored signer is this server's COPY, so the replay-nonce ledger it maintains is the SERVER's. That is correct here -- signer and verifier are different roles, and in the real topology they are different processes sharing only the secret.QCSXTZZZIBWU
RequiresSignedRequests
request authentication (off-loopback listeners)aucune extension
MountAuth
HARO COPY SEMANTICS (read this): `=` and list insertion both COPY an object, so the server holds ITS OWN stzAuth. Configure and register BEFORE mounting. For a view shared with the caller (and durability), give the stzAuth a stzAuthDbStore: its sqlite is an engine handle, so the server's copy reads and writes the SAME database -- a login through HTTP is then visible to the caller's object, and vice versa.QCSXTZZZIBWU
MountAuthAt
user authentication router (stzauth)QCSXTZZZIBWU
AuthIsMounted
user authentication router (stzauth)aucune extension
AuthPrefix
user authentication router (stzauth)aucune extension
SetSecureCookies
Add Secure to the auth cookies -- TRUE whenever the listener is TLS, so the session cookie never travels in clear text.QCSXTZZZIBWU
SecureCookies
user authentication router (stzauth)aucune extension
MountOidcProvider
/authorize needs a signed-in user, and takes it from the SESSION COOKIE the mounted auth router issues -- so this server's own login becomes the login for every app that trusts it. With no session it answers 401 (the app in front redirects to its login page and comes back).QCSXTZZZIBWU
MountOidcProviderAt
oidc provider (this server as an idp)QCSXTZZZIBWU
OidcProviderIsMounted
oidc provider (this server as an idp)aucune extension
OidcProviderPrefix
oidc provider (this server as an idp)aucune extension
AuthWhy
Why the last request was refused ("" when none was).aucune extension
HostAgents
WHY EVERYTHING GOES THROUGH THE SERVER. Haro copies objects on `=`, so the host stored here is the server's own copy: a caller who kept the original would watch a snapshot that never ticks. That is why the supervision and read methods below DELEGATE instead of handing the host out -- the same cure stzAgentHost itself applies to its agents, and stzSuperApp to its governance. Reach the live host only through these.aucune extension
AdoptAgentHost
Adopt a host configured elsewhere (e.g. one carrying a decommission governance declared up front). It is REPARENTED onto this server's loop, and the caller's reference goes stale by the rule above.aucune extension
IsHostingAgents
(sans commentaire dans la source : le nom se lit comme une phrase) is hosting agentsdans la section agents: the agent host is the same hostaucune extension
SetAgentSlice
How long a single serve slice may park on the socket before due agents are ticked. Smaller = crisper agent timing, more loop turns.QCSXTZZZIBWU
AgentSlice
(sans commentaire dans la source : le nom se lit comme une phrase) agent slicedans la section agents: the agent host is the same hostaucune extension
SuperviseAgent
supervision, delegated to the live hostaucune extension
SuperviseAgentOnEvent
(sans commentaire dans la source : le nom se lit comme une phrase) supervise agent on eventdans la section agents: the agent host is the same hostaucune extension
NumberOfAgents
(sans commentaire dans la source : le nom se lit comme une phrase) number of agentsdans la section agents: the agent host is the same hostaucune extension
AgentNames
(sans commentaire dans la source : le nom se lit comme une phrase) agent namesdans la section agents: the agent host is the same hostaucune extension
AgentTicks
(sans commentaire dans la source : le nom se lit comme une phrase) agent ticksdans la section agents: the agent host is the same hostaucune extension
AgentIsActive
(sans commentaire dans la source : le nom se lit comme une phrase) agent is activedans la section agents: the agent host is the same hostaucune extension
AgentIsRetired
(sans commentaire dans la source : le nom se lit comme une phrase) agent is retireddans la section agents: the agent host is the same hostaucune extension
AgentTrace
(sans commentaire dans la source : le nom se lit comme une phrase) agent tracedans la section agents: the agent host is the same hostaucune extension
PauseAgent
control. IN-PROCESS ONLY, deliberately (see _ServeAgents)aucune extension
ResumeAgent
(sans commentaire dans la source : le nom se lit comme une phrase) resume agentdans la section agents: the agent host is the same hostaucune extension
RetireAgent
Governed teardown: refused until the agent's declared obligations are fulfilled (R4b). Returns FALSE with AgentWhy() explaining the refusal.aucune extension
AgentWhy
(sans commentaire dans la source : le nom se lit comme une phrase) agent whydans la section agents: the agent host is the same hostaucune extension
DeclareAgentDecommission
(sans commentaire dans la source : le nom se lit comme une phrase) declare agent decommissiondans la section agents: the agent host is the same hostaucune extension
FulfillAgentObligation
(sans commentaire dans la source : le nom se lit comme une phrase) fulfill agent obligationdans la section agents: the agent host is the same hostaucune extension
ListenRaw
A raw TCP listener (no HTTP framing): fHandler is called as call fHandler(oServer, nSid, nConn, cBytes) for every chunk a device sends; reply with RawWrite(). Requires a running server (the listener joins the same reactor).aucune extension
RawPort
iot: raw stream listeneraucune extension
RawWrite
iot: raw stream listeneraucune extension
ParseHttpRequest
Parse one complete HTTP/1.1 request (the engine frames it: full headers + Content-Length body, CRLF line endings).aucune extension

