stop-token icon indicating copy to clipboard operation
stop-token copied to clipboard

figure out how to work with temporal streams too

Open yoshuawuyts opened this issue 3 years ago • 3 comments

Screenshot_20220108-235531

Screenshot_20220108-235822

yoshuawuyts avatar Jan 08 '22 22:01 yoshuawuyts

We need to distinguish between a deadline and a boundary. Deadlines are hit exactly once. Boundaries can be hit multiple times.

yoshuawuyts avatar Jan 08 '22 22:01 yoshuawuyts

Maybe we should rename {AsyncIter, Future}::until with:

  • AsyncIter::timeout takes impl Boundary
  • AsyncIter::timeout_at takes impl Deadline
  • Future:timeout takes impl Boundary
  • Future::timeout_at takes impl Deadline

note: timeout_at takes StopToken, Instant, and possibly SystemTime.

yoshuawuyts avatar Jan 08 '22 23:01 yoshuawuyts

Prior art for this naming:

  • https://www.learnrxjs.io/learn-rxjs/operators/utility/timeout
  • https://docs.rs/tokio/latest/tokio/time/index.html#functions

yoshuawuyts avatar Jan 08 '22 23:01 yoshuawuyts