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
This code is very similar to the way tokio-rayon works (as they both use the suggestion from the tokio readme itself: use a oneshot), but with one difference: impedance catches panic's and allows users to unpack and resume unwinds.
Today, I was looking into adding a more complete api to impedance that lets users easily use rayon ParallelIterators that contain references (https://github.com/guswynn/impedance/blob/setup/src/rayon.rs#L50-L57), but I hit a snag: rust-lang/rust#70263 (comment) that may not be easy to resolve. Therefore, I an interested in offering a more general api that would be the same as tokio_rayon::spawn, except catching panics. This would let users write things like:
My understanding is that the MIT licenses on our projects are very permissive so this shouldn't be a licensing problem, but I wanted to let you know of the similarities between your crate and this (planned) section of my crate and see if you have any objections to me offering such an api. Also, if tokio-rayon in the future exports an API that exposes panics to the caller, then it might be possible to have impedance just re-export, and that may be something I am interested in!
The text was updated successfully, but these errors were encountered:
Oh I see: https://github.com/andybarron/tokio-rayon/pull/1/files now, this is new from the last time I looked into this crate! Panic's are propagated, whereas the api I have chosen is to pass along the panic payload. The above information still stands though!
i was actually quite torn on catching vs propagating panics, but some feedback from r/rust convinced me to do it this way (since you can always just catch_unwind if you care). but yes, feel free to steal as much or as little code as you want! looks like a great project and a lot more general-purpose than this little guy 👍
i was actually quite torn on catching vs propagating panics, but some feedback from r/rust convinced me to do it this way (since you can always just catch_unwind if you care). but yes, feel free to steal as much or as little code as you want! looks like a great project and a lot more general-purpose than this little guy 👍
I have been working on a library that is supposed to make it easier to work with blocking code while writing async programs: https://docs.rs/impedance/0.3.0/impedance/
One such module in this library is the rayon one. Currently, this provides a function that lets you correctly use a
'static
rayonParallelIterator
in an asynchronous fashion: https://docs.rs/impedance/0.3.0/impedance/rayon/fn.par_iter.htmlThis code is very similar to the way
tokio-rayon
works (as they both use the suggestion from the tokio readme itself: use a oneshot), but with one difference:impedance
catches panic's and allows users to unpack and resume unwinds.Today, I was looking into adding a more complete api to impedance that lets users easily use rayon
ParallelIterator
s that contain references (https://github.com/guswynn/impedance/blob/setup/src/rayon.rs#L50-L57), but I hit a snag: rust-lang/rust#70263 (comment) that may not be easy to resolve. Therefore, I an interested in offering a more general api that would be the same astokio_rayon::spawn
, except catching panics. This would let users write things like:My understanding is that the MIT licenses on our projects are very permissive so this shouldn't be a licensing problem, but I wanted to let you know of the similarities between your crate and this (planned) section of my crate and see if you have any objections to me offering such an api. Also, if
tokio-rayon
in the future exports an API that exposes panics to the caller, then it might be possible to haveimpedance
just re-export, and that may be something I am interested in!The text was updated successfully, but these errors were encountered: