Closed ffrizzo closed 2 years ago
Hi @ffrizzo - thanks for this PR! Can I ask why the need to remove channels?
The channels were probably removed because https://github.com/ffrizzo/surrealdb.go/blob/bae20d4af2b438a458d088f1932b7628c889ff8b/internal/websocket/ws.go#L72 handles the "waiting" for the response.
(And as such, the code here does not need to wait for it using channels - it blocks until the response is received from Send
.)
Update implementation of websocket for code clarity/quality
Have removed channels to reduce code complexity Move the logic of waiting for websocket response to the Send function and this now returns the result or error
⚠️ This PR is based on #25 and on #26. ⚠️ The relevant commit on this one is https://github.com/surrealdb/surrealdb.go/commit/bae20d4af2b438a458d088f1932b7628c889ff8b