This commit is contained in:
2026-06-15 10:47:24 +00:00
parent ca125c99d2
commit 06823ee547
28 changed files with 1243 additions and 1383 deletions

View File

@@ -22,11 +22,9 @@ func (s *Inbox) Ready() chan struct{} {
}
func (s *Inbox) Push(x any) {
//fmt.Printf("inbox.Push: %#v\n", x)
s.mutex.Lock()
s.items = append(s.items, x)
s.mutex.Unlock()
//fmt.Printf("inbox.Pushed\n")
select {
case s.signalCh <- struct{}{}:
default:
@@ -34,11 +32,9 @@ func (s *Inbox) Push(x any) {
}
func (s *Inbox) Drain() []any {
//fmt.Printf("inbox.Drain\n")
s.mutex.Lock()
items := s.items
s.items = nil
s.mutex.Unlock()
//fmt.Printf("inbox.Drained: %#v\n", items)
return items
}