-
Notifications
You must be signed in to change notification settings - Fork 606
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
Unblock server on multiple HTTP requests #3
Conversation
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.
terminal print out:
Promise warning: Promise resolved after resolved
Promise warning: Promise resolved after resolved
Promise warning: Promise resolved after resolved
@zhmushan It’s a deno issue, see denoland/deno#1273 |
Sorry, I just saw this issue.😭 |
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.
Nice work - I'm glad you got it working :)
It's unfortunate that this logic is so complex now.. Isn't there some simpler way this can be done? Ideally without using Promise.race ?
e535d63
to
88028b8
Compare
88028b8
to
020880e
Compare
Kinda bit stuck with implementing a simpler logic. (After getting rid of Promise.race I would really hope that the deferred and new array each time could also go away...) |
5cd6e50
to
eeb06ce
Compare
6950e83
to
70a9643
Compare
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.
LGTM
Closes #1 .
Resolve the immediate cause for blocking, by making new conn accept and readRequest of same level and async,
with. NowPromise.race
http_test.ts
should work properly.(Currently there will be warnings ofPromise resolved after resolved
. The warning would go away after denoland/deno#1273)Socket is closed for now once responding. Will need to change this behavior later.Sockets are left open now until EOF.I'm not quite sure if this fix is proper, and whether I should keep
serveConn
(since it is exported)I will work more on http based on feedback for this change.