So I’m writing this plugin for a program that facilitates websockets. I’ve almost finished but I hit a brick wall with a receiver getting dropped.
Basically, there are two channels, one is a stdlib one that simply acts as a queue when new data arrives, so the host app’s event loop can query it and trigger callbacks. The second one is for when the host app needs to send data on the websocket.
The problem is, this one is somehow getting dropped and I get this error at runtime:
send failed because receiver is gone
On this line:
where the host app calls to send some data to the channel which is consumed by the futures combinator spaghetti.
I’ve been trying to figure this one out for a while now - I thought my combinator code was wrong so I even rewrote the entire thing but I can’t seem to solve it. I don’t know how the receiver is being dropped, it’s
moved into the combinator closure and used to forward data to the stream sink.
Would love to get this last piece of the puzzle solved, thanks!