MCPcopy Index your code
hub / github.com/codechenx/FastTableViewer / loadDataAsync

Function loadDataAsync

ftv.go:91–107  ·  view source on GitHub ↗

loadDataAsync starts async loading and waits for initial data

(loader func(*Buffer, chan<- bool, chan<- error), b *Buffer)

Source from the content-addressed store, hash-verified

89
90// loadDataAsync starts async loading and waits for initial data
91func loadDataAsync(loader func(*Buffer, chan<- bool, chan<- error), b *Buffer) (chan bool, chan error, error) {
92 userMovedCursor = false // Reset cursor tracking
93 updateChan := make(chan bool, 10)
94 doneChan := make(chan error, 1)
95
96 loader(b, updateChan, doneChan)
97
98 // Wait for initial data or error
99 select {
100 case <-updateChan:
101 // Initial data ready
102 return updateChan, doneChan, nil
103 case err := <-doneChan:
104 // Error during initial loading
105 return nil, nil, err
106 }
107}
108
109// runApp starts the UI application if not in debug mode
110func runApp() error {

Callers 1

loadAndDisplayAsyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected