Implement some sort of rate limiting
Some checks failed
Run Tests / Test (push) Failing after 17s
Benchmark BufferPool / RunBenchmarks (push) Failing after 28s

This commit is contained in:
2024-08-02 11:13:40 +02:00
parent e8b9eb934b
commit 0315a0877b
4 changed files with 69 additions and 23 deletions

14
main.go
View File

@@ -175,12 +175,16 @@ func main() {
client.Enable()
for {
if client.Connected {
err := client.Send(submit)
if err != nil {
log.Printf("Failed to send PDU: %v", err)
}
// err := client.Send(submit)
// if err != nil {
// log.Printf("Failed to send PDU: %v", err)
// }
go client.Send(submit)
// if rand.Int() % 1000 == 0 {
// client.SendLimit.Set(rand.Int() % 1000)
// }
}
time.Sleep(10 * time.Millisecond)
time.Sleep(500 * time.Millisecond)
}
log.Println("Are we done")