Add ResultWriter type

This commit is contained in:
Ken Hibino
2021-09-20 15:10:28 -07:00
parent b10504998a
commit f06404a9a8
7 changed files with 150 additions and 0 deletions

View File

@@ -198,6 +198,15 @@ func (tb *TestBroker) PublishCancelation(id string) error {
return tb.real.PublishCancelation(id)
}
func (tb *TestBroker) WriteResult(qname, id string, data []byte) (int, error) {
tb.mu.Lock()
defer tb.mu.Unlock()
if tb.sleeping {
return 0, errRedisDown
}
return tb.real.WriteResult(qname, id, data)
}
func (tb *TestBroker) Ping() error {
tb.mu.Lock()
defer tb.mu.Unlock()