Hwaro::Services::Server
Inherits Reference / Object
Constants
DEBOUNCE_INTERVAL = 300.milliseconds
Debounce interval: after detecting changes, wait this long for additional changes to settle before triggering a rebuild.
MAX_DEBOUNCE_ITERATIONS = 10
Maximum number of debounce iterations before forcing a rebuild. Prevents indefinite blocking when files are being written continuously.
POLL_INTERVAL = 500.milliseconds
Polling interval for the file watcher.
WATCHER_IGNORE_PATTERNS = [/\.bak$/, /~$/, /\.swp$/, /\.swo$/, /\.swx$/, /\.DS_Store$/, /(?:\A|\/)\.#[^\/]+$/, /(?:\A|\/)#[^\/]+#$/, /\.tmp$/, /\.crswap$/, /___jb_tmp___$/, /___jb_old___$/, /(?:\A|\/)\.goutputstream-[^\/]+$/, /(?:\A|\/)4913$/, /(?:\A|\/)\.(?:git|obsidian|idea|vscode)\//]
Paths matching these regexes are treated as editor byproducts
(backups, swap files, autosaves, OS metadata) and are excluded
from the watcher. Editors using rename-based atomic save or
keep-a-backup patterns (vim's default, sed -i.bak, emacs,
JetBrains, …) used to double-trigger rebuilds — once for the
real edit and once for the byproduct — and each event forced a
full rebuild (see server.cr :full strategy fallback).
Constructors
new
SourceInstance methods
run(options : Config::Options::ServeOptions)
Sourcerun(host : String = "127.0.0.1", port : Int32 = 3000, drafts : Bool = false)
Source