Documentation
¶
Overview ¶
Package service is the toy stateful service behind mission #74's exercise (goapplib issue 75). Its ingest builds a compact result through a much larger scratch allocation, the way agni's engine parses and lays out a design, and it keeps the result between requests. The wasm main serves it from a Web Worker through wasmhost; the tests serve it natively.
Plain JSON over net/http rather than Connect: the mission is about state, memory and concurrency, and exercise/wasmhost already covers Connect over workerFetch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IngestRequest ¶
IngestRequest sizes an ingest: PeakMB of scratch on the way to a ResultMB result.
type Service ¶
Service holds the result of the last ingest. Cache, when set, is where /open looks for a result before ingesting, and where it keeps one after.
type State ¶
type State struct {
// IngestCount is how many ingests this process has run. A state restored from the cache
// rather than rebuilt leaves it at 0.
IngestCount int `json:"ingestCount"`
ResultBytes int `json:"resultBytes"`
Checksum string `json:"checksum"`
// LastJob is how the last /longjob ended: "", "completed" or "cancelled".
LastJob string `json:"lastJob"`
// Restored says the result came from the cache rather than an ingest.
Restored bool `json:"restored"`
// CacheError is the last cache failure other than a miss, for the exercise to show.
CacheError string `json:"cacheError,omitempty"`
}
State is what GET /state reports.