scylladb / seastar

High performance server-side application framework
http://seastar.io
Apache License 2.0
8.36k stars 1.55k forks source link

Turn send_helper() send-recv into a .then-chain #1104

Open xemul opened 2 years ago

xemul commented 2 years ago

This place:

https://github.com/scylladb/seastar/blob/f3749938ad9f77cce04359805742ba96aa635602/include/seastar/rpc/rpc_impl.hh#L480

deserves being a standard continuation chain to avoid when_all state allocation (and extra task to collect result) for no gain.

tchaikov commented 2 years ago

without adding an entry in _outstanding expecting the reply from peer first, it'd be impossible to unblock wait_for_reply() if we receives the reply before wait_for_reply() gets scheduled. it's like a dilemma of edge-triggered event versus level-triggered event. i think we are using edge-triggered event here.