Avril
7b438a930f
Merge branch 'allow-await-async-timeout-func'
3 years ago
Avril
d6f9ff7817
AsyncTimeout: Now handles async functions for `thing` correctly. Improved `timeout_example(_timeout, cancel)` (+ `Cancellation` class for async cancellations). Added `try_example(time)` which runs the default example and cancels after `time`, returning the value or error in an object containing either `{ value: true }` or `{ error: <caught error> }` when awaited.
...
Added AsyncTimeout.await_timeout(time): Returns a promise that resolves when `time` has passed. No value is returned from this promise.
Added AsyncTimeout.await_interval(time): Returns an async iterator that yields after `time` has passed. No value is yielded from this async iterator.
(These helper functions are essentially the same as `new AsyncTimeout(()=>{}, time).[timeout/interval]()`.)
Fortune for async-timeout-js's current commit: Middle blessing − 中吉
3 years ago
Avril
0d9f2adb04
Semaphore: Added `try_acquire()`, `try_using()` (see docs). Added `bind_using(func)` to returned a bound function of `func` to `this.using`.
...
Fortune for async-timeout-js's current commit: Middle blessing − 中吉
3 years ago
Avril
77926dd1f9
Semaphore: Added `try_acquire()`, `try_using()` (see docs). Added `bind_using(func)` to returned a bound function of `func` to `this.using`.
...
Fortune for async-timeout-js's current commit: Small blessing − 小吉
3 years ago
Avril
b2070f1918
Semaphore: Better example function. Changed `Semaphore.Mutex()` -> `Semaphore.mutex()` to avoid class naming convention confusion.
...
Fortune for async-timeout-js's current commit: Small blessing − 小吉
3 years ago
Avril
caad3ce5b6
Merged `Semaphore` from master
...
Fortune for async-timeout-js's current commit: Small curse − 小凶
3 years ago
Avril
d54a5e8f51
Uhh, fixed semaphore. It works now.
...
I forgot to actually return the promise in the `next.acquire()` lambda lmao.
Fortune for async-timeout-js's current commit: Half curse − 半凶
3 years ago
Avril
d151412576
WHY DOESN"T THIS FUKCINGA I STUPID THING WORK????? RESOLVE IS ***PROVEN*** TO ____NOT____ BE CALLED IN THE PROMISE CTOR SO WHY THE FUCK IS THAT PROMISE RESOLVING IMMEDIATELY!??!?!?!??!???!??!??!?!?!?!?
...
Fortune for async-timeout-js's current commit: Future blessing − 末吉
3 years ago
Avril
bc64ae9232
semaphore attampt 1: failure
...
Fortune for async-timeout-js's current commit: Curse − 凶
3 years ago
Avril
4f9c541715
Changed `exmaple()` to `console.log()` instead of `alert()`.
...
Fortune for async-timeout-js's current commit: Blessing − 吉
3 years ago
Avril
ed32e1586b
Changed `exmaple()` to `console.log()` instead of `alert()`.
...
Fortune for async-timeout-js's current commit: Future blessing − 末吉
3 years ago
Avril
e58db0b0b9
Fix syntax error
...
Fortune for async-timeout-js's current commit: Middle blessing − 中吉
3 years ago
Avril
881be9a6e7
Fix syntax error
...
Fortune for async-timeout-js's current commit: Blessing − 吉
3 years ago
Avril
e01d0d8534
Update README
...
Fortune for async-timeout-js's current commit: Blessing − 吉
3 years ago
Avril
05daa18891
Update README
...
Fortune for async-timeout-js's current commit: Small blessing − 小吉
3 years ago
Avril
f9f85f36e1
Failed attempt at allowing async functions to be passed as `thing`: This will need a complete redesign to support this and I don"t care enough right now to do it.
...
Fortune for async-timeout-js's current commit: Middle blessing − 中吉
3 years ago
Avril
66a5c7cc05
Initial commit
...
Added the `AsyncTimeout(func, delay)` class, with awaitable `timeout()` and `for await`able `interval()`.
Added documentation to the class
Added a `example()` function that can show how it works or how to use it.
Added README that has the title and what the file does.
Fortune for async-timeout-js's current commit: Great blessing − 大吉
3 years ago