Documentation
¶
Overview ¶
Package server implements the WebSocket service described in docs/PROTOCOL.md, connecting downstream sessions to hark.Engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Tokens []string // empty: no authentication
Default string // default engine name
MaxSession time.Duration // max duration of one session; 0 = unlimited
FinishTimeout time.Duration // how long to wait for upstream to finalize after finish (also bounds each rollover)
// Rollover bounds how much audio one engine stream receives before the session moves to a fresh stream at a
// pause (see session.Options.Rollover). 0 = session.DefaultRollover.
Rollover time.Duration
// AudioQueue is how much audio each engine track buffers; when full, backpressure applies.
AudioQueue time.Duration
// StallTimeout is how long to wait at most once a track's audio queue is full; beyond it the engine is considered stuck and only that track is ended.
StallTimeout time.Duration
// SpoolDir is where output-mode final tracks keep committed text beyond 64KB until track_end; "" = os.TempDir().
SpoolDir string
// Vocab is the personal vocabulary store; nil means disabled.
Vocab *vocab.Store
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Shutdown ¶
Shutdown stops accepting new connections and sessions. In-flight sessions may finish normally until ctx expires; those still running then are aborted with shutting_down. It returns only after sessions have wrapped up (all engine Streams closed) and all connections are closed; after that the engine instances can be closed safely. ctx only sets the grace period and does not bound the return time (a hung engine is left to the process manager). It may be called more than once.