pitrou commented on code in PR #36205: URL: https://github.com/apache/arrow/pull/36205#discussion_r1243877475
########## TODOs.txt: ########## @@ -0,0 +1,17 @@ +- Use a uniform API for all async Flight client APIs: + + void Foo(const FlightCallOptions&, shared_ptr<ReadListener<T>> listener); + + - shared_ptr, or raw pointer? (gRPC uses the latter...) Review Comment: weak_ptr is a smart non-owning pointer, so it provides both memory safety _and_ lack of cyclic references: exactly what we seem to be after here? My experience, at least, is that trying to do async programming with raw pointers or references is extremely fragile and difficult to get right (there are all kinds of subtle issues, for example with destructors and virtual methods as you yourself found out :-)). (FTR: even in Python, I sometimes resorted to weakrefs when async programming) @westonpace Thoughts? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
