Azolo / websockex

An Elixir Websocket Client
MIT License
519 stars 100 forks source link

async option not working? #126

Closed feld closed 1 year ago

feld commented 1 year ago

The async option doesn't seem to work as nothing happens anymore when that's enabled. Is this implemented correctly?

https://github.com/Azolo/websockex/blob/4a94f6870528f45d64cdd47bd4374faf52528466/lib/websockex.ex#L542-L554

https://github.com/Azolo/websockex/blob/4a94f6870528f45d64cdd47bd4374faf52528466/lib/websockex.ex#L1144-L1153

feld commented 1 year ago

The problem was misunderstanding how some of this is meant to work, and needing to move logic out of start_link and put into a handle_info/2 callback instead which we trigger from handle_connect/2 and then everything works great.

Reading discussion in https://github.com/Azolo/websockex/issues/34 will put you on the right track.