Summary
HTTPReactorServer currently invokes the request handler synchronously on the
SocketReactor thread. A slow handler stalls every other connection bound to
that reactor.
Proposal
Make POCO's existing AsyncNotificationCenter available as an optional
dispatch backend so users can opt into worker-thread handler execution when
they need it. Reactor threads then only do I/O readiness.
Per @aleks-f's feedback: the dispatcher stays synchronous by default
(switching it on globally would spawn extra threads and risk surfacing
thread-unsafe handler code in existing deployments). The setting is explicit
opt-in, configured on the server / HTTPServerParams. When enabled, both
the request side and a future non-blocking response-write path (driven by
WritableNotification) can run async.
No change to the HTTPRequestHandler contract.
Summary
HTTPReactorServercurrently invokes the request handler synchronously on theSocketReactorthread. A slow handler stalls every other connection bound tothat reactor.
Proposal
Make POCO's existing
AsyncNotificationCenteravailable as an optionaldispatch backend so users can opt into worker-thread handler execution when
they need it. Reactor threads then only do I/O readiness.
Per @aleks-f's feedback: the dispatcher stays synchronous by default
(switching it on globally would spawn extra threads and risk surfacing
thread-unsafe handler code in existing deployments). The setting is explicit
opt-in, configured on the server /
HTTPServerParams. When enabled, boththe request side and a future non-blocking response-write path (driven by
WritableNotification) can run async.No change to the
HTTPRequestHandlercontract.