Closed GlassyYang closed 2 years ago
See #16 This design is on purpose: the producer must respond to the Interest first before it performs any operation that takes time.
Should we ensure whether interest is not expired or not like this way: we just sleep a certain time, and cancel the task when it is still running. with async function, we can tell user their callback takes too long rather than let user debug and find this problem by themself.
You can use create_task
to do whatever you want. There is no need to modify the library.
An async callback delays not only this packet but also blocks all future packets.
That's remind me. Thank you very much.
python-ndn
is writen by coroutine, but app doesn't support async function register, which means if a user-registered callback function is a timing consuming operation, it will still block everything. under this situation,async callback register
is extreamily useful.