feat(server): spawn task sooner in listenloop#1102
feat(server): spawn task sooner in listenloop#1102pankgeorg wants to merge 6 commits intoJuliaWeb:masterfrom
Conversation
f804214 to
fd18b80
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1102 +/- ##
==========================================
- Coverage 82.71% 82.57% -0.14%
==========================================
Files 32 32
Lines 3054 3065 +11
==========================================
+ Hits 2526 2531 +5
- Misses 528 534 +6 ☔ View full report in Codecov by Sentry. |
Seeing old PRs it may be either that |
Yes, i think that's it. And i think we rely on that in our internal Server code (at RAI)... i see this comment in some internal server code # HTTP.serve! uses `@async` under the hood. Because of `@async` and because there are no
# yield points during server state manipulation, we can modify the server state within
# `handle_*` methods without having to worry about thread safety, like we would if
# HTTP.serve! used `@spawn` to handle requests. Actual work is done in the `@spawn`ed
# tasks which **don't** access the `Server`. |
|
Makes sense. I think the spirit of this PR doesn't need |
|
I'm not sure how to fix the invalidations :(
|
|
Sorry for the confusion, I just missed an |
|
Benchmarked it on a simple hello world endpoint with beforeafter |
To clarify, we're still in favour of changing At RAI we currently have some code that is written based on the assumption HTTP is using |
UsesThreads.@spawninstead of@asyncin listenloopconnsdict lockable because that's also not thread safe in itself if I understand correctly.(this work has a lot of ideas and snippets from @tanmaykm 🙏🏽)