-
Notifications
You must be signed in to change notification settings - Fork 5.3k
udp: limit number of reads per event loop #16180
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
Changes from all commits
a84505d
879cd6f
24ae38d
48a644f
b89f7fe
758c321
ded13a6
51c3404
f0949ea
0858725
001f228
efb5bef
09ba49d
fb6bb16
372b3e3
2151e2d
d9989e8
e0aae6f
dcda8e8
80e91f6
8cd5cda
45e3518
3be3b84
3d82197
077b6d3
33d1bd3
9928fb3
5700114
3ec57b7
7c0b9d4
c3f20a5
6622e2b
d8538ed
ee2db2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,6 +330,11 @@ class UdpListenerCallbacks { | |
| * Posts ``data`` to be delivered on this worker. | ||
| */ | ||
| virtual void post(Network::UdpRecvData&& data) PURE; | ||
|
|
||
| /** | ||
| * An estimated number of UDP packets this callback expects to process in current read event. | ||
| */ | ||
| virtual size_t numPacketsExpectedPerEventLoop() const PURE; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is READ in all caps? also for naming is this the number of packets expected, or the number of packets the listener should be willing to read? Should we make it clear in comments this is TCP specific?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. READ doesn't need to be all caps. Fixed. For the naming confusion, what's the difference between "the number of packets expected" and "the number of packets the listener should be willing to read"? This interface provides a hint to UDP listener but eventually the listener will decide how many to read.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
READ doesn't need to be all caps. Fixed.
What's the difference between "the number of packets expected" and "the number of packets the listener should be willing to read"? This interface provides a hint to UDP listener but eventually the listener will decide how many to read.
UDP specific? This is in UdpListenerCallbacks after all.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's expected vs allowed to be read. and yes, I meant UDP. UdpPackets maybe since tcp packets are a thing too? |
||
| }; | ||
|
|
||
| using UdpListenerCallbacksOptRef = absl::optional<std::reference_wrapper<UdpListenerCallbacks>>; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.