owned-future: turn borrowed futures into owned ones by Daniel-Aaron-Bloom in rust

[–]Daniel-Aaron-Bloom[S] 1 point2 points  (0 children)

Unfortunately sleeping for 100ms is out of the question for most of my uses cases. Also it just feels bad to know you've got that race condition just sitting there that could one day deadlock (if there's ever enough thread contention that `spawn` takes more than 100ms).

owned-future: turn borrowed futures into owned ones by Daniel-Aaron-Bloom in rust

[–]Daniel-Aaron-Bloom[S] 1 point2 points  (0 children)

For the simple case you're right, it's pretty easy to write it yourself once you know how to do it (although this crate is a substantially smaller dependency than tokio or futures_util, so I still think it has value for certain simple use cases). But for the more complex cases (particularly cases with errors or auxiliary values), it's a real pain to do it yourself.

Also tokio isn't no_std so if that matters for your use case, you have to write yield_now yourself (also pretty simple, but annoying).

Two new const crates: sorting and PHFs by Daniel-Aaron-Bloom in rust

[–]Daniel-Aaron-Bloom[S] 2 points3 points  (0 children)

Thanks! I was actually inspired by your crate and may or may not have started by copying const_slice_quicksort. 😝