Re: [wake-lock] Canceling using AbortSignal is a bit weird (#171)

I think the other key thing that @kenchris was trying to solve was a way of releasing wake locks from code that doesn't have a reference to either the WakeLock or AbortSignal instance. As mentioned in my option (2) above it is possible we can just consider this a programming error.

I agree with @domenic that it doesn't make sense to have two methods of doing the same thing. I am attracted to adding `abort()` to `WakeLock` because it matches the pattern of other APIs I've worked on that have `start()` and `stop()`, or `open()` and `close()` methods. I agree that we have defined the behavior of the AbortSignal so that it can still release the lock after it has been acquired but that still feels unnatural to me and so I expect developers to be confused. Contrast this to APIs like `fetch()` where a request is "done" at some point and can no longer be aborted.

-- 
GitHub Notification of comment by reillyeon
Please view or discuss this issue at https://github.com/w3c/wake-lock/issues/171#issuecomment-484210440 using your GitHub account

Received on Wednesday, 17 April 2019 18:34:53 UTC