Jeffrey Qiu
2018-06-01 09:35:51 UTC
The protocol is defined as:
interface Test {
interface Callback {
call @0 (id :UInt64) -> ();
}
runCallback @1 (cb : Callback) -> ();
}
The Callback is implemented in client side:
class CallbackImpl(callback_capnp.Test.Callback.Server):
def call(self, id, **kwargs):
print ("Call back from client, id = %s" % id)
In server side, it is defined as:
class Server(callback_capnp.Test.Server):
def runCallback(self, cb, **kwargs):
cb.call(1);
time.sleep(5)
cb.call(2);
From client side, run cap.runCallback(CallbackImpl()).wait()
The expected result is:
1. Call back from client, id = 1
2. 5 seconds sleep
3. Call back from client, id = 2
But actually result is:
1. 5 seconds sleep
2. Call back from client, id = 1
3. Call back from client, id = 2
What's the matter? How to implement the expect result?
-Jeffrey
interface Test {
interface Callback {
call @0 (id :UInt64) -> ();
}
runCallback @1 (cb : Callback) -> ();
}
The Callback is implemented in client side:
class CallbackImpl(callback_capnp.Test.Callback.Server):
def call(self, id, **kwargs):
print ("Call back from client, id = %s" % id)
In server side, it is defined as:
class Server(callback_capnp.Test.Server):
def runCallback(self, cb, **kwargs):
cb.call(1);
time.sleep(5)
cb.call(2);
From client side, run cap.runCallback(CallbackImpl()).wait()
The expected result is:
1. Call back from client, id = 1
2. 5 seconds sleep
3. Call back from client, id = 2
But actually result is:
1. 5 seconds sleep
2. Call back from client, id = 1
3. Call back from client, id = 2
What's the matter? How to implement the expect result?
-Jeffrey
--
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.
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.