Q: How the server start requests to the client?

30 views
Skip to first unread message

林晓锋

unread,
Oct 25, 2019, 2:25:45 AM10/25/19
to Cap'n Proto
Hi, @all:
    It is mentioned that "Requests and responses can go in any direction." at FAQ (https://capnproto.org/faq.html) , I would like to know is there any example of the server start requests to the client?

Kenton Varda

unread,
Oct 25, 2019, 5:26:11 PM10/25/19
to 林晓锋, Cap'n Proto
Yes, the "calculator" sample program does this, where the client can send the server a `Function` implementation, and the server calls back to it.


The trick here is that any message (including parameters or results of an RPC call) can contain references to new objects (`interface` types). If the client creates an implementation of an RPC interface and then sends it to the server via some other call, then the server can call back to that object.

-Kenton

On Thu, Oct 24, 2019 at 11:25 PM 林晓锋 <lxf4...@gmail.com> wrote:
Hi, @all:
    It is mentioned that "Requests and responses can go in any direction." at FAQ (https://capnproto.org/faq.html) , I would like to know is there any example of the server start requests to the client?

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/adcd84af-4385-49e0-a08b-08c7241e48a2%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages