Hi Kenton,

Our company is attempting to use Cap'n Proto in a soft-realtime system 
where we need tight control over the resolution of promises. Our problem is 
that we have some existing synchronous processing which needs to run 
frequently and timely (on the order of 100 microseconds) but our system 
must also service incoming RPCs (which might access results of said 
processing) without missing a single processing window.

What we would like to be able to do roughly corresponds the below 
pseudocode inside our server:

loop forever:
  if before synchronous processing window:
    poll single event
  else:
    do synchronous processing

*WaitScope::poll* almost fulfills our needs, but it causes all new events 
since the last poll to be picked up and their corresponding promises to be 
resolved, in this case to incoming requests, which can occasionally cause 
us to miss our window. Our individual RPC functions are relatively 
short-lived, but when receiving many in a short span of time, we encounter 
this timing issue.

I think what we're looking for is an overload to *WaitScope::poll* limiting 
the turn count:
https://pastebin.com/T4eFM60F

Your thoughts? Otherwise could this be something that might be accepted as 
a small pull request?

Useful details:

   - C++ 17 with official capnp/kj library
   - Linux 5.x kernel (so UnixEventPort as async provider)



Rowan Reeve

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/17eba638-4bbe-49fe-a270-c5e40b40b967n%40googlegroups.com.

Reply via email to