MCPcopy
hub / github.com/jesseduffield/lazygit / Do

Method Do

pkg/tasks/async_handler.go:31–42  ·  view source on GitHub ↗
(f func() func())

Source from the content-addressed store, hash-verified

29}
30
31func (self *AsyncHandler) Do(f func() func()) {
32 self.mutex.Lock()
33 self.currentId++
34 id := self.currentId
35 self.mutex.Unlock()
36
37 self.onWorker(func(gocui.Task) error {
38 after := f()
39 self.handle(after, id)
40 return nil
41 })
42}
43
44// f here is expected to be a function that doesn't take long to run
45func (self *AsyncHandler) handle(f func(), id int) {

Callers 8

TestAsyncHandlerFunction · 0.95
WriteMethod · 0.80
fetchRecentPRsAuxMethod · 0.80
promptEditorMethod · 0.80
RefreshSuggestionsMethod · 0.80
NewCmdTaskMethod · 0.80
NewTaskMethod · 0.80

Calls 2

handleMethod · 0.95
onWorkerMethod · 0.80

Tested by 1

TestAsyncHandlerFunction · 0.76