httpserver

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 8 Imported by: 0

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

func RegisterHTTPServerPreload(v *vm.VM)

RegisterHTTPServerPreload installs the `httpserver` module under package.preload.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL