Queued application events never read #76

Closed
opened 2 years ago by steampoweredtaco · 1 comments

Thanks so much for this project; I like it.

Now the issue I ran into using cview@v1.5.6 is that the Application.events channel is not read anywhere I can find in the code. So, Application.QueueEvent does not result in an event that is processed and also the event resize throttle mechanism are also never processed.

If you checkout application.go you'll find that the chanel for events Application.events (a.events) is only used as a sender twice and never as a receiver.

This could leave the app in a state of many AfterFuncs goroutines stuck and also my code that uses QueueEvent to lock up after the channel becomes saturated.

I think adding this to run may fix it:

	go func() {
		for eveny := range a.events {
			semaphore.Lock()
			handle(event)
			semaphore.Unlock()
		}
	}()

However I think this could make a race between throttled resize events and the screen, so maybe it should be part of the main screen event loop somehow.

Unfortunatly I don't know of a way to workaround this issue currently for QueueEvent because the handle function isn't reachable from my package.

Thanks so much for this project; I like it. Now the issue I ran into using cview@v1.5.6 is that the Application.events channel is not read anywhere I can find in the code. So, Application.QueueEvent does not result in an event that is processed and also the event resize throttle mechanism are also never processed. If you checkout application.go you'll find that the chanel for events Application.events (a.events) is only used as a sender twice and never as a receiver. This could leave the app in a state of many AfterFuncs goroutines stuck and also my code that uses QueueEvent to lock up after the channel becomes saturated. I think adding this to run may fix it: ```go go func() { for eveny := range a.events { semaphore.Lock() handle(event) semaphore.Unlock() } }() ``` However I think this could make a race between throttled resize events and the screen, so maybe it should be part of the main screen event loop somehow. Unfortunatly I don't know of a way to workaround this issue currently for QueueEvent because the handle function isn't reachable from my package.
tslocum referenced this issue from a commit 2 years ago
tslocum closed this issue 2 years ago
Owner

Thanks for reporting this.

Thanks for reporting this.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tslocum/cview#76
Loading…
There is no content yet.