square / okio

A modern I/O library for Android, Java, and Kotlin Multiplatform.
https://square.github.io/okio/
Apache License 2.0
8.72k stars 1.17k forks source link

Implement AsyncTimeout.cancel() #1396

Closed swankjesse closed 6 months ago

swankjesse commented 6 months ago

This is a simple implementation that uses 3 booleans to keep state (inQueue, isCanceled, hadTimeoutWhenCanceled). I'd like to do a follow-up change to replace 3 booleans with a proper state variable, especially since that eliminates some impossible states (like inQueue and isCanceled).