14 karma · joined Aug 28, 2022 (4y ago) · 4 submissions
comment 3y ago · link · parent
The post mentions that it might be the caller's or the callee's responsibility to keep the object alive until the end of the coroutine. This is purely based on conventions however, and different libraries might have different conventions. If the caller is responsible for it, extra care needs to be taken whenever the function is called -- the code shown in the post seems fairly complex to me and easy to get wrong. Also, I am not sure how the callee could safely implement keeping the object alive if lazy coroutines are used: Even if the first statement in the coroutine is retaining a strong reference on the object, there might still be a time between the call and the initial resume of the coroutine where the object is destroyed. I think it would have been great to provide explicit capture lists for coroutines, similar to lambdas.
All of this gets especially confusing once you try to use lambdas together with coroutines. AFAIK, C++ lambdas are basically just structs overloading operator(). In a coroutine, only the "this" pointer of the structure is captured and the caller needs to ensure that the object is not only alive, but also at the same memory address until the end of the coroutine. This is very easy to get wrong in my experience.
comment 4y ago · link · parent
- The content type: The syndication feed provider only supports "article" content which is just a string with rich text formatting. The HN feed provider allows Fluent Feeds to download and display the complete comment tree for every item right inside the app.
- The content storage: When a syndication feed is synchronized, its complete content is stored in a local database – including the item content. This is not necessary for the HN feed provider as it loads the comments using the API whenever the user selects the item for the first time or when the user manually reloads the content.
In addition, the HN feed provider is a demonstration of the app's modular approach. Once plugin support is implemented, it will probably be provided as a separate plugin that can be added by the user.
3.
Show HN: Fluent Feeds – A feed reader for Windows 11(hannesschulze.github.io ↗)
17 points · by hannes_s · 4y ago · 2 comments