You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not clear whether a promise is cancelled and/or destroyed when all references to a promise (outside of the library's internals) go out of scope. I had presumed that underlying KJ promises were detached or wrapped into a kj::TaskSet because there does not seem to be any way to start background tasks in pycapnp and usually my "fire-and-forget" promises would still be resolved.
Below are three minimal reproductions that can be run inside an interactive interpreter to show that Promise chains do not resolve if the reference is dropped, though oddly only after a GC collection rather than immediately (implying that the refcount isn't zero).
Additionally, returning a promise chain (but not keeping our own reference) from an RPC (including ones returning void, i.e. -> ()) seems to temporarily transfer ownership and resolve before replying to the client caller.
It is not clear whether a promise is cancelled and/or destroyed when all references to a promise (outside of the library's internals) go out of scope. I had presumed that underlying KJ promises were detached or wrapped into a
kj::TaskSet
because there does not seem to be any way to start background tasks inpycapnp
and usually my "fire-and-forget" promises would still be resolved.Below are three minimal reproductions that can be run inside an interactive interpreter to show that Promise chains do not resolve if the reference is dropped, though oddly only after a GC collection rather than immediately (implying that the refcount isn't zero).
Keep reference, run GC
Drop reference, run GC
Drop reference, no GC
Should a separate issue be raised to integrate
kj::Promise::detach
orkj::TaskSet
intopycapnp
(if I haven't missed something)?The text was updated successfully, but these errors were encountered: