Provide guidance on how to 'async' additems to a list?
#77
Closed
opened 2 years ago by caninodev
·
1 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Disclaimer: I am just learning about concurrency (actually because of the following use case?). I have a slice of IDs for postings. Rather than batch fetch all the related data with each ID (which would cause a potentially long wait before the screen is drawn), I thought that this would be an ideal use for Go's
chan
type. (Please correct me if I am wrong).So I thought to have the following:
Then when coding out the ui, I have the following:
And yet the output is not rendered. What have I done wrong? (The full source can be found at github.com/CaninoDev/hackernewsterm (the refresh branch) I would appreciate any help in clarifying whether this is a use case for chan.
The application is drawn after input events automatically, but must otherwise be drawn by calling
Draw
orQueueUpdateDraw
. I've just added aDraw
call toSetRoot
to make changes immediately visible.