-
Notifications
You must be signed in to change notification settings - Fork 187
Open
Description
The OnConnect callback (added in #137) is only sent during the readLoop
so it will only be triggered after the server sends an event, which could be some time (or even never) after a connection is established:
Line 231 in c6d5381
c.connectedcb(c) |
It seems the callback could and should be called here instead, directly after the HTTP response:
Lines 98 to 100 in c6d5381
defer resp.Body.Close() | |
reader := NewEventStreamReader(resp.Body, c.maxBufferSize) |
Lines 152 to 156 in c6d5381
if !connected { | |
// Notify connect | |
errch <- nil | |
connected = true | |
} |
or, at the top of readLoop
Metadata
Metadata
Assignees
Labels
No labels