summaryrefslogtreecommitdiff
path: root/redo/uitask.go
diff options
context:
space:
mode:
Diffstat (limited to 'redo/uitask.go')
-rw-r--r--redo/uitask.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/redo/uitask.go b/redo/uitask.go
index 462a24b..b4fa77c 100644
--- a/redo/uitask.go
+++ b/redo/uitask.go
@@ -19,7 +19,19 @@ func Go() error {
return nil
}
-// TODO Stop
+// Stop returns a Request for package ui to stop.
+// Some time after this request is received, Go() will return without performing any final cleanup.
+// If Stop is issued during an event handler, it will be registered when the event handler returns.
+func Stop() *Request {
+ c := make(chan interface{})
+ return &Request{
+ op: func() {
+ uistop()
+ c <- struct{}{}
+ },
+ resp: c,
+ }
+}
// This is the ui main loop.
// It is spawned by Go as a goroutine.