mirror of
https://github.com/shouptech/tempgopher.git
synced 2026-02-03 08:39:43 +00:00
21 lines
256 B
Go
21 lines
256 B
Go
package main
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
// RunWeb launches a web server
|
|
func RunWeb(sc <-chan State, done <-chan bool, wg *sync.WaitGroup) {
|
|
states := make(map[string]State)
|
|
|
|
go func() {
|
|
for {
|
|
s := <-sc
|
|
states[s.ID] = s
|
|
}
|
|
}()
|
|
|
|
<-done
|
|
|
|
wg.Done()
|
|
}
|