Now keyboard events will be handled in order, but the consequence is computation-intense may need to be moved to a seperate goroutine otherwise it may delay the next event call.
This commit is contained in:
Zack Guo 2017-04-06 17:20:54 +08:00
parent 383c12d69e
commit 86c275c69b
1 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ func hookTermboxEvt() {
e := termbox.PollEvent()
for _, c := range sysEvtChs {
go func(ch chan Event) {
func(ch chan Event) {
ch <- crtTermboxEvt(e)
}(c)
}
@ -244,7 +244,7 @@ func (es *EvtStream) Loop() {
case "/sig/stoploop":
return
}
go func(a Event) {
func(a Event) {
es.RLock()
defer es.RUnlock()
if pattern := es.match(a.Path); pattern != "" {