software steht so weit.

jetzt build + docker build und testen
This commit is contained in:
br committed 2026-10-02 13:25:34 +02:00
1 parent 42f0c0accb
commit ca6cdcca63
90 files changed
+10298 -480

No files matched your search

+6
View File
@@ -38,6 +38,9 @@ type Client struct {
MinBackoff, MaxBackoff time.Duration
// OnError wird in Run vor jeder Wartezeit mit dem Grund aufgerufen.
OnError func(err error, retryIn time.Duration)
// OnConnect wird nach jedem erfolgreichen Verbindungsaufbau aufgerufen,
// bevor Events gelesen werden – z. B. um den eigenen Zustand neu zu senden.
OnConnect func()
sleep func(ctx context.Context, d time.Duration) error // für Tests ersetzbar
}
@@ -102,6 +105,9 @@ func (c *Client) connect(ctx context.Context, handle func(Event) error) (connect
return false, fmt.Errorf("%w: Content-Type %q", ErrUnexpectedResponse, resp.Header.Get("Content-Type"))
}
if c.OnConnect != nil {
c.OnConnect()
}
idle := c.idleTimeout()
timer := time.AfterFunc(idle, func() { cancel(ErrIdleTimeout) })
defer timer.Stop()