Documentation
¶
Overview ¶
Package httpserver provides the `httpserver` native module — an HTTP *server* to complement the client-only `http` module.
Concurrency model: the.lsc VM is single-threaded and not safe for concurrent access, but net/http dispatches every request on its own goroutine. This module bridges the two with a serialized design:
- `server:listen(addr)` BLOCKS on the calling (VM) goroutine and runs a loop that is the *only* place Lua handlers are ever invoked.
- net/http's per-request goroutines merely marshal the request into a Lua table, push a job onto a channel, and block waiting for the reply. They never touch the VM.
As a result every handler runs serially on the VM goroutine — simple and race-free, at the cost of no request-level parallelism.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHTTPServerPreload ¶
RegisterHTTPServerPreload installs the `httpserver` module under package.preload.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.