Commit graph

114 commits

Author SHA1 Message Date
eryn L. K
168239707b
Merge pull request #28 from FableRBX/patch-1
Update Tour.md
2020-06-10 16:57:36 -04:00
FableRBX
6fb7ed746f
Update Tour.md 2020-06-10 13:53:24 -07:00
eryn L. K
36b789e2b6
Update README.md 2020-06-02 01:00:03 -04:00
eryn L. K
061c3a8659
Merge pull request #24 from evaera/use-xpcall
v3 (xpcall & better debugging)
2020-06-02 00:58:40 -04:00
Eryn Lynn
bcbd3385f4 Update docs 2020-06-02 00:54:36 -04:00
Eryn Lynn
b7d6a935be Update documentation 2020-06-02 00:19:02 -04:00
Eryn Lynn
b4ba6d2414 Add Promise.fromEvent
closes #14
2020-05-29 02:10:45 -04:00
Eryn Lynn
e5843cf5a2 Add Promise.retry
Closes #16
2020-05-29 02:10:29 -04:00
Eryn Lynn
8cb4b21f60 Write docs for Promise.each 2020-05-13 20:16:07 -04:00
Eryn Lynn
0c0d7f0464 Add Promise.each
closes #21
2020-05-13 19:48:45 -04:00
Eryn Lynn
078abeae83 improve api reference 2020-05-13 17:12:22 -04:00
Eryn Lynn
1ad5ab8b3e fix capitalization 2020-05-11 15:43:58 -04:00
Eryn Lynn
fc134adb73 mprove Promise.delay accuracy 2020-05-11 15:43:50 -04:00
Eryn Lynn
266e265e20 Allow rejection with error objects 2020-05-11 15:43:35 -04:00
Eryn Lynn
faa4f73dd3 Add Promise:now()
closes #23
2020-05-06 19:22:48 -04:00
Eryn Lynn
ff345ea31b Expose & refactor RuntimeError 2020-05-06 18:02:10 -04:00
Eryn Lynn
292e47293c Let Promise:expect() throw rejection objects 2020-05-06 14:20:34 -04:00
Eryn Lynn
0c30e0c40b Merge branch 'master' into use-xpcall 2020-05-05 18:15:45 -04:00
Eryn Lynn
fd120b5c76 Update CHANGELOG.md 2020-05-04 23:57:08 -04:00
Eryn Lynn
1ca3fff6f5 Use xpcall, revamp error handling 2020-05-04 23:56:49 -04:00
Eryn Lynn
344c9759aa Update testez
Closes #1
2020-05-04 22:07:55 -04:00
Eryn Lynn
7c394f4d61 Remove unused files 2020-05-04 22:07:36 -04:00
eryn L. K
e06f087d54
Update CHANGELOG.md 2020-05-04 15:29:11 -04:00
eryn L. K
2e63e8b7cc
Merge pull request #22 from ddavness/promise-is-pcall
Use pcall() on Promise.is when looking for the .andThen function
2020-05-04 15:27:12 -04:00
David Duque
9cf49499bd
Apply suggestions
Co-authored-by: eryn L. K. <eryn@eryn.io>
2020-05-04 20:19:54 +01:00
David Duque
4586cc5a90
Use pcall() on Promise.is when looking for the .andThen function
Some tables might have strict metatables that error if a non-existant
member is indexed, causing the chain to fail.
2020-05-02 19:24:05 +01:00
Eryn Lynn
17becff40b Update dependencies for docs website 2020-04-29 19:41:45 -04:00
eryn L. K
dfd3251849
Create FUNDING.yml 2020-04-24 17:51:14 -04:00
Eryn Lynn
57d98880b5 make promisify test more clear 2020-04-17 20:00:54 -04:00
eryn L. K
01499e5b7f
Merge pull request #19 from Quenty/users/quenty/avoid_realloc
Avoid reallocating another table for the _consumers() metatable, lead…
2020-03-29 18:16:49 -04:00
James Onnen
ffd4cd94a1
Avoid reallocating another table for the _consumers() metatable, leading to a 5%-10% speed up of the trivial Promise.new(function() end) case 2020-03-29 03:35:15 -07:00
eryn L. K
f0fd3020fd
Merge pull request #18 from Validark/patch-1
Optimize Promise.delay with linked-list impl
2020-02-28 21:21:16 -05:00
Eryn Lynn
5a4a30e221 Fix broken tests 2020-02-28 21:21:01 -05:00
Niles
4e6b0de633
Update init.lua 2020-02-14 15:08:53 -06:00
Niles
e1e183d632
Optimize Promise.delay with linked-list impl
- Always iterate over promises via `ipairs`
- Avoid pushing the call arguments stack to a table in Promise.prototype.expect and Promise.prototype.await
- Use a doubly-linked list implementation of a queue

The old queue/dequeue implementation used an array which:
    - has items removed from the front (`table.remove(queue, 1)` O(n) each time)
        - this is especially bad in the main loop which could run multiple times in-a-row on a large array
        - new: O(1)
    - uses table.insert() followed by table.sort() to add a new node (O(n log n))
        - new: O(n)
    - has to lookup the index of the node being dequeued (O(n))
        - new: O(1)
2020-02-14 06:02:48 -06:00
Eryn Lynn
64ba0099f1 Pass error to executor runner 2020-02-12 19:59:04 -05:00
Eryn Lynn
87937962ad Add traceback piping to more functions 2020-02-12 18:55:29 -05:00
Eryn Lynn
4ecdd156a5 awaitvalue -> expect 2019-11-12 23:14:18 -05:00
Eryn Lynn
85240d83b7 Fix rejection propagation issue 2019-11-12 23:07:43 -05:00
Eryn Lynn
f4202bdc0d Fix timeout return value doc 2019-11-12 21:32:16 -05:00
Eryn Lynn
4daaf7ee5d Update done docs 2019-09-30 20:50:05 -04:00
Eryn Lynn
de4a43d32e Update CHANGELOG.md 2019-09-29 02:05:04 -04:00
Eryn Lynn
75d82b4909 Add allSettled, some, and any
Closes #10
Closes #11
Closes #5
2019-09-29 02:03:22 -04:00
Eryn Lynn
cef64024e6 Add Promise.delay, :timeout
Closes #8
Closes #7
2019-09-29 00:07:32 -04:00
Eryn Lynn
f32ebd35bb Add docs warning 2019-09-28 23:29:00 -04:00
Eryn Lynn
bb13a0e2b6 Add Return and done
Closes #9
2019-09-28 22:03:06 -04:00
Eryn Lynn
3052ec1474 Add Promise.try 2019-09-28 18:54:49 -04:00
Eryn Lynn
f6c3dd163a Make resolve/reject accept multiple values
Closes #4
2019-09-28 17:48:55 -04:00
Eryn Lynn
c0626c0baf Make promisify catch errors
Closes #12
2019-09-28 17:38:35 -04:00
Eryn Lynn
65daff4777 Improve stack traces and errors 2019-09-28 05:14:53 -04:00