Closed stephencheng closed 6 years ago
It looks like this race condition is happening in tcell
. You may want to open an issue there.
Generally, you should be able to use goroutines in a tview
project. For example, if you write text to a TextView
, you can do that asynchronously. And many of the functions in Application
are thread-safe, too.
If you're setting attributes of a primitive concurrently in multiple goroutines, e.g. List.SetCurrentItem()
or Table.SetCell()
, you may have to synchronize those updates yourself. I guess I couldn't think of any real-life cases where you would need these functions to be thread-safe. But if you run into trouble with these in your project, let me know and I'll see if I can find a solution.
Thanks for replying
Firstly, I'd say I am amazed by this project. It's great work there.
I was using termui and now entirely stuck with lots of effort dealing with the user interaction and found it is a dead end. And I am lucky to just land here to find a rescue.
I am not sure if a data race warning should be concerned at all as I just run it for the very basic example of a box, see below
I am considering using tview to deal with a timely refresh to get data for each tab(page), would it be even possible that I can use go route to deal with the backend task(to get some server end data) for each page in the background?
Thank you