craps
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s
Build and Publish / BuildAndDeploy (push) Successful in 2m25s

This commit is contained in:
matst80
2024-11-13 20:16:40 +01:00
parent dafefa377f
commit 9f7c8227c2
6 changed files with 299 additions and 22 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"log"
"sync"
"time"
)
type PacketQueue struct {
@@ -98,7 +99,19 @@ func (p *PacketQueue) Expect(messageType PoolMessage) <-chan CallResult {
return l.Chan
}
ch := make(chan CallResult)
ch := make(chan CallResult, 1)
go func() {
time.Sleep(time.Millisecond * 300)
p.mu.Lock()
defer p.mu.Unlock()
ch <- CallResult{
StatusCode: 504,
Data: []byte("timeout cart call"),
}
close(ch)
}()
p.expectedPackages[messageType] = &Listener{
Count: 1,
Chan: ch,