Esc

close_server

procedureextensionexperimentalsince 0.36.1Source
  • macOS: close_server works on macOS
  • Linux: close_server works on Linux
  • Windows: close_server works on Windows
  • Wasm: close_server works on Wasm

Stops, joins and releases an owned Server handle, clearing the caller's pointer. Active servers require their owning Io scheduler. After this returns, no alias of the old pointer may be used; caller-owned App/state/TLS configs can be freed. Safe to call again on the cleared pointer.

Signature

close_server :: (server: **Server)
Example
server, error := start(*app);
// Serve requests on this scheduler, then:
close_server(*server);

See also