Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logic to flush channels, and to safeguard adding of events, after… #739

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bhbosman
Copy link

Add logic to flush channels, and to safeguard adding of events, aftermain loop in Application.Run exited

refactor
@digitallyserviced
Copy link
Contributor

Thanks for this!!!

I just started trying out this library and after seeing the done guard application.go:380 I honestly have no idea what the point of QueueUpdate{,Draw} was because the there was never anything setup to be on the other side of the channel to pump something so it can drain... and because it relies on a message it received rather than the status of the channel, closing it is useless too... That change was made 13 months ago... has it been broken that long?

@bhbosman
Copy link
Author

bhbosman commented Jul 7, 2022

Hi,

From the examples, and the general use case, the tview/Application will always be in the main method and will cease to exist, when the application terminate.

In my use case, I am using the tview/Application to manage a reader/writer stream from a SSH channel. This is a bit different from the general use case, and my application does not terminate when the SSH / tview/Application terminate. I need to close and drain the channels, to clear resources.

I removed some of the done guards, as it was excessive. Can not answer you on QueueUpdate{,Draw}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants