Closed andychenbruce closed 1 year ago
The changes makes sense to me. I think we should send_blocking in this case as well. Regaring the joinhandle yeah we're supposed to await it. This has? to occur at the end of the output stream somehow. Could the Output possibly hold the handle?
On second thought LGTM
If I understand correctly:
Before, the
spawn_blocking
was actually returning another function that was async which would then get awaited which undoes the whole purpose of thespawn_blocking
.The async doesn't work that well since it doesn't have any
await
s other than the one locking the mutex, and I couldn't figure out how to get that to work inspawn_blocking
so now it's changed toblocking_lock
.Also now join handle doesn't get awaited so if the thread panics it doesn't really handle it (I think the mutex lock can also get messed up with a panicked thread?), I don't know the proper way do deal with that.