mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 02:38:31 +00:00
Add OnServerHeartbeat to Redbean (#522)
This commit is contained in:
parent
066ed2b2b2
commit
42bd79a461
2 changed files with 30 additions and 5 deletions
|
@ -554,6 +554,12 @@ HOOKS
|
|||
each time redbean reaps a child connection process using wait4().
|
||||
This won't be called in uniprocess mode.
|
||||
|
||||
OnServerHeartbeat()
|
||||
If this function is defined it'll be called from the main process
|
||||
on each server heartbeat. The heartbeat interval is configurable
|
||||
with ProgramHeartbeatInterval. If this hook is defined, then
|
||||
`/.heartbeat.lua` is not called.
|
||||
|
||||
OnServerListen(socketdescriptor:int,serverip:int,serverport:int) → bool
|
||||
If this function is defined it'll be called from the main process
|
||||
before redbean starts listening on a port. This hook can be used
|
||||
|
@ -1368,6 +1374,10 @@ FUNCTIONS
|
|||
as Content-Range and Date, which are abstracted by the transport
|
||||
layer.
|
||||
|
||||
ProgramHeartbeatInterval(milliseconds:int)
|
||||
Sets the heartbeat interval (in milliseconds). 5000ms is the default
|
||||
and 100ms is the minimum.
|
||||
|
||||
ProgramTimeout(milliseconds:int|seconds:int)
|
||||
Default timeout is 60000ms. Minimal value of timeout is 10(ms).
|
||||
Negative values (<0) sets the keepalive in seconds.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue