Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async await using libuv #83
async await using libuv #83
Changes from 26 commits
a096073
b363ee0
621bfb9
b226549
eea0b24
3fe213a
db2f958
02e938e
7b9c2ac
2ccda6b
4fe5f84
23553f3
7062489
dab2d92
de8ac26
430a2d0
1bc875a
68af03b
8915094
e1e44b1
9234048
6906da0
60368ff
53ab866
b682e78
7fc1214
02fe675
1c4559b
0fd0f1a
dc68752
c5efd4d
83378a0
2e3ef66
bab7509
578cd63
0c96921
8384d3d
fbd402c
1666282
e24a703
f74b094
522a7b8
ffcf332
2c9f3a9
58ac59d
73c4c81
e3e3e8f
14c734d
79640e9
92afbb9
fc4557f
4767627
60ea7d9
1752ae5
df921db
374d7cd
981a291
2765ee5
6dfa6fc
5f2d6e5
5233604
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about making
callback
required and making a new function likestart
or something? Idk, I'm not sure I like having it optional callback (haven't thought a lot about it yet tho)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a bit weird that here we pass
nil
and above (line 119) we passcallback or function() end
-- I'd like to make it more consistent perhaps. Seems fine though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are supposed to be completely opposite functions which is why they are not consistent.
await
will yield the function and run a future asynchronously and then resume when it is done. Passing in nil to any future will await it in an async context.callback or function() end
is used because passing a function into a future will run it in a none async function meaning it does not yield. Not passing in a function will still run it, hence theor
. Using the or basically forces it to be a function. Futures are created using thewrap
function andasync
function. In those functions you can see that there are if statements checking if we passed innil
or a function. What type of argument we passed in controls the behavior.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this create a future? I'd like to rename this maybe to
to_future
? idk, what are your thoughts?