Discussion:
[capnproto] A client can implement a Function on the client side and the server will call back to it
Jeffrey Qiu
2018-05-31 09:14:40 UTC
Permalink
The calculator.capnp in examples mentioned:

# A client can create a Function that runs on the server side using
# `defFunction()` or `getOperator()`. * Alternatively, a client can*
* # implement a Function on the client side and the server will call
back*
* # to it.* However, a function defined on the client side will require
a
# network round trip whenever the server needs to call it, whereas
# functions defined on the server and then passed back to it are called
# locally.

How to do it with Python?
--
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.
Visit this group at https://groups.google.com/group/capnproto.
'Kenton Varda' via Cap'n Proto
2018-05-31 15:40:05 UTC
Permalink
Hi Jeffrey,

Unfortunately the author of the Python implementation hasn't been active in
a while and I'm not sure if anyone else here knows the answer. You may have
to dig into the code a bit. I'm pretty sure this is supported, though.

-Kenton
Post by Jeffrey Qiu
# A client can create a Function that runs on the server side using
# `defFunction()` or `getOperator()`. * Alternatively, a client can*
* # implement a Function on the client side and the server will call
back*
* # to it.* However, a function defined on the client side will
require a
# network round trip whenever the server needs to call it, whereas
# functions defined on the server and then passed back to it are called
# locally.
How to do it with Python?
--
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
Visit this group at https://groups.google.com/group/capnproto.
--
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.
Visit this group at https://groups.google.com/group/capnproto.
Jeffrey Qiu
2018-06-01 01:26:18 UTC
Permalink
Then how to do it with C++?

圚 2018幎5月31日星期四 UTC+8䞋午11:40:18Kenton Varda写道
Post by 'Kenton Varda' via Cap'n Proto
Hi Jeffrey,
Unfortunately the author of the Python implementation hasn't been active
in a while and I'm not sure if anyone else here knows the answer. You may
have to dig into the code a bit. I'm pretty sure this is supported, though.
-Kenton
Post by Jeffrey Qiu
# A client can create a Function that runs on the server side using
# `defFunction()` or `getOperator()`. * Alternatively, a client can*
* # implement a Function on the client side and the server will call
back*
* # to it.* However, a function defined on the client side will
require a
# network round trip whenever the server needs to call it, whereas
# functions defined on the server and then passed back to it are called
# locally.
How to do it with Python?
--
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
Visit this group at https://groups.google.com/group/capnproto.
--
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.
Visit this group at https://groups.google.com/group/capnproto.
Jeffrey Qiu
2018-06-01 03:04:55 UTC
Permalink
Ignore the question.
There is a sample function PowerFunction in the calculator client.
It is what I am looking for.

圚 2018幎6月1日星期五 UTC+8䞊午9:26:18Jeffrey Qiu写道
Post by Jeffrey Qiu
Then how to do it with C++?
圚 2018幎5月31日星期四 UTC+8䞋午11:40:18Kenton Varda写道
Post by 'Kenton Varda' via Cap'n Proto
Hi Jeffrey,
Unfortunately the author of the Python implementation hasn't been active
in a while and I'm not sure if anyone else here knows the answer. You may
have to dig into the code a bit. I'm pretty sure this is supported, though.
-Kenton
Post by Jeffrey Qiu
# A client can create a Function that runs on the server side using
# `defFunction()` or `getOperator()`. * Alternatively, a client can*
* # implement a Function on the client side and the server will call
back*
* # to it.* However, a function defined on the client side will
require a
# network round trip whenever the server needs to call it, whereas
# functions defined on the server and then passed back to it are called
# locally.
How to do it with Python?
--
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
Visit this group at https://groups.google.com/group/capnproto.
--
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.
Visit this group at https://groups.google.com/group/capnproto.
Loading...