svgserver

command
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Command svgserver renders imzero2 (egui) views and serves them as SVG over HTTP. It drives the GPU-less `headless_svg` imzero2 client (see rust/imzero2/src/imzero2/headless_svg.rs): each HTTP request is handed to the single render thread, which renders one egui window from the request payload, asks the client to export that window as SVG (ExportSvgWindow), reads the resulting file back, and returns it as image/svg+xml.

Threading contract: the imzero2 `c.*` API is strictly single-threaded and belongs to the render loop only. HTTP handlers run on their own goroutines and never touch `c.*`; they hand work to the render loop over a channel and wait for the result on a per-request reply channel (the "main-thread handoff" pattern). One request is rendered at a time — the render loop serialises them.

This is a pragmatic prototype (ADR path A). Deferred: concurrency beyond one-in-flight (would need per-request egui contexts), auth/TLS, DPR/size negotiation, and response caching.

Jump to

Keyboard shortcuts

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