aboutsummaryrefslogtreecommitdiff
path: root/wsc.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Implement course selection started/stopped statesRunxi Yu2024-10-101-0/+41
| | | | Implements: https://todo.sr.ht/~runxiyu/cca/13
* wsc.go: Check newCtx.Done() when entering other event casesRunxi Yu2024-10-101-12/+25
| | | | | | | | | | We select the context done channel when entering other cases too (see below) because we need to make sure the context cancel works even if both the cancel signal and another event arrive while processing a select cycle. It's a bit verbose and looks repetitive but is technically more correct than code without it.
* {courses,wsc}.go: Atomic 64-bit alignmentRunxi Yu2024-10-091-1/+1
|
* wsc.go: Use sync.Map for cancelPool to reduce lock contentionRunxi Yu2024-10-091-21/+10
|
* *.go: Update commentsRunxi Yu2024-10-091-0/+1
|
* *.go: Use sync.Map instead of map[int]*courseT for coursesRunxi Yu2024-10-091-15/+28
| | | | I'm not sure whether this is actually better than locking.
* {courses,wsc,wsp}.go: Usems should be sync.MapRunxi Yu2024-10-091-10/+2
| | | | | This is a classic few-reads, many-writes situation where a sync.Map would lead to substantially less lock contention.
* {courses,wsc,wsm}.go: map[courseGroupT](bool->struct{})Runxi Yu2024-10-081-1/+1
| | | | | This makes it use slightly less memory. Approximately courseGroupT bits per connection!
* *.go: Further wrap errorsRunxi Yu2024-10-081-3/+7
|
* Reapply "{config,wsc}.go, cca.scfg.example: Dynamic course update delay"Runxi Yu2024-10-071-1/+11
| | | | This reverts commit 831040c3d7dbc116a25848786bc5ab83fef6149b.
* Revert "{config,wsc}.go, cca.scfg.example: Dynamic course update delay"Runxi Yu2024-10-071-11/+1
| | | | This reverts commit de3f0b9e7003e4521f5ea866134e77ff859ab99b.
* wsc.go: Fix race condition with usemCount atomicsRunxi Yu2024-10-071-1/+6
| | | | Atomics must be read atomically via atomic.LoadT
* *.go: Limit to approximately 80 characters per lineRunxi Yu2024-10-061-10/+57
|
* {config,wsc}.go, cca.scfg.example: Dynamic course update delayRunxi Yu2024-10-061-1/+6
|
* {courses,wsc,wsm,wsp}.go: Send course number immediately on user interactionRunxi Yu2024-10-061-9/+2
|
* *: Overhaul structure again and embed everythingRunxi Yu2024-10-061-0/+266
| | | | | | | | - Remove sub-Makefiles; recursive make is annoying - Just use one top-level Makefile that builds everything - Embed templates and minified static resources into the binary - Embed all compiled documentation into the binary and serve - Embed all source into the binary and serve
* *.go: Move to backendRunxi Yu2024-10-051-266/+0
| | | | And adjust Makefiles, admin handbook, and lint.sh accordingly.
* {,u}sem.go, ws*.go: Restructure filesRunxi Yu2024-10-051-0/+266