Open kostanovych opened 6 years ago
rawUpdates can be accessed from multiple goroutines, but it's not synchronized.
rawUpdates
https://github.com/Arman92/go-tdlib/blob/2f743ae341ab7b1fc6a43de1625ba76b46fdebf1/tdlib.go#L109-L112
https://github.com/Arman92/go-tdlib/blob/2f743ae341ab7b1fc6a43de1625ba76b46fdebf1/tdlib.go#L161-L164
Should use lock for it. Here's related question on Stack Overflow. Also, looks like it's possible to miss some updates, if GetRawUpdatesChannel was called with some delay.
GetRawUpdatesChannel
You're correct, also if GetRawUpdatesChannel get's called twice, the first channel will be lost.
I'll fix this as soon as I got the time.
rawUpdates
can be accessed from multiple goroutines, but it's not synchronized.https://github.com/Arman92/go-tdlib/blob/2f743ae341ab7b1fc6a43de1625ba76b46fdebf1/tdlib.go#L109-L112
https://github.com/Arman92/go-tdlib/blob/2f743ae341ab7b1fc6a43de1625ba76b46fdebf1/tdlib.go#L161-L164
Should use lock for it. Here's related question on Stack Overflow. Also, looks like it's possible to miss some updates, if
GetRawUpdatesChannel
was called with some delay.