dispatcher: prevent job limit errors with no subscribers (#1196)

* prevent dispatch error limit

* fixes typo, update benchmark

* big simplification on concept

* fix tests

* can't stop finding leftovers
This commit is contained in:
Scott
2023-07-06 15:37:53 +10:00
committed by GitHub
parent 81a8b4a575
commit 2a6581bd57
4 changed files with 76 additions and 13 deletions

View File

@@ -53,6 +53,9 @@ type Dispatcher struct {
// dispatcher write protection
m sync.RWMutex
// subscriberCount atomically stores the amount of subscription endpoints
// to verify whether to send out any jobs
subscriberCount int32
}
// job defines a relaying job associated with a ticket which allows routing to