Skip to content

Can we send ResponseFinal before Query dropping? #117

Answered by p-avital
pojiro asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there,

To my knowledge, there isn't (nor should be) a way to do that. In general, Zenoh relies on destructors a lot, so I wouldn't recommend trying to bypass destructors, but rather see how you can ensure that they are called properly by your wrapper.

The way we've done that in the Kotlin and Python bindings is that we generally store provide the binding objects with Option<T> where T is the type that has useful drop behaviour. Then, the implementation of close() for that binding object calls a rust function that calls Option::take, allowing T to be dropped properly.

I'm not very familiar with Elixir, but if you want to avoid forcing the user to remember calling query.send_final(), a f…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pojiro
Comment options

Answer selected by pojiro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants