Replies: 1 comment 2 replies
-
Haha, argh I just figured out where the records go. Into the StreamHandler for my StreamingWebSocket class. I was expecting that to only get messages from the client. So I guess I could parse the incoming records and see if they are supposed to go to the client or if they are FROM the client. This seems suboptimal. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
async stream connection
I'm attempting to connect an async stream to a websocket to write some records. In my server, where the records originate, I see printlns for all the records. But nothing is reaching the client.
I'm using add_stream to connect my stream. Any hints? Maybe add_stream doesn't do what I think it does, which is write the stream contents to the socket.
I got it to work before with a non-async function. But that one appears to read in all the records before anything is written to the websocket. I'd rather read the records lazily as they are needed.
error mapping
Maybe more of a stream question than an actix-web question. My async stream function initially has my app's error type zkerr::Error. That's convenient because I can use ? in that function. But to pass to add_stream I need a ws::ProtocolError type. I'm just making a nonsense error there. I'd like to pass in my actual error but map_err seems unaware of the type of the original error. Or something. Anyway I can't even log the error because no type. Hints welcome! The error I get on uncommmenting the logging code:
Beta Was this translation helpful? Give feedback.
All reactions