Updating the view with asynchronous messages #305
-
First of all, I just want to say that this library is incredible. I'm having so much fun writing my first project using this tooling. I can't understate how amazing the codebase is. I'm currently writing a tcpdump-esque TUI, and I think I've achieved the minimum level of functionality-- that is, a user can select their network interface, specify a packet filter, and the packets start streaming into a viewport. However, I'm not sure if I'm updating the viewport properly, as it feels a bit... Janky.
I call a method that starts recording filtered packets on an interface. Inside the start method...
With source.Packets() being a channel, receiving packets as they come in. Next, using the Process and (m *model) Update functions....
Does that.... Seem right? Calling Thank you very much for the pleasure of using these tools. Again, huge fan. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
After doing some more research, I think the answer is using channels to communicate, as seen in this example. |
Beta Was this translation helpful? Give feedback.
After doing some more research, I think the answer is using channels to communicate, as seen in this example.