You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use case: I'm being really silly and make a super non-serious "sync only, no async" "WebSocket server" (if you can call it that) based off request.upgrade() from this library.
I was trying to do this (kind of dirty/gross/might be the wrong approach) but I am not sure if it is right. Would be interested to hear some feedback/if what I am trying is a bad idea.
An alternative would be on CustomStream to be able to get .reader() .writer() somehow?
The text was updated successfully, but these errors were encountered:
brandonros
changed the title
Be able to split Read + Write out of CustomStream
Be able to split Read + Write out of CustomStream for Sync across threads?
Nov 11, 2023
Use case: I'm being really silly and make a super non-serious "sync only, no async" "WebSocket server" (if you can call it that) based off
request.upgrade()
from this library.tiny-http/src/util/custom_stream.rs
Line 4 in e221563
The problem is, I want to have 2 threads.
1 that reads from client -> server
1 that writes server -> client
I haven't found a good way to "non-lockingly + non-blockingly" handle this because
custom_stream
doesn't have.split()
I don't know what we would run into in terms of borrow/lifecycle issues, but I'm having a hard time figuring out how to achieve this trait wise.
I was trying to do this (kind of dirty/gross/might be the wrong approach) but I am not sure if it is right. Would be interested to hear some feedback/if what I am trying is a bad idea.
An alternative would be on CustomStream to be able to get .reader() .writer() somehow?
The text was updated successfully, but these errors were encountered: