Skip to content

Commit

Permalink
Add clarification that PollEvent and ChannelEvents are incompatible
Browse files Browse the repository at this point in the history
  • Loading branch information
eNV25 committed Jun 11, 2021
1 parent 63444b7 commit 6224fe8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions screen.go
Expand Up @@ -79,9 +79,14 @@ type Screen interface {
Size() (int, int)

// ChannelEvents is an infinite loop that waits for an event and
// channels it into the user provided channel. When Fini() is called
// or quit is closed, the function returns. This function should be
// used as a goroutine.
// channels it into the user provided channel ch. Closing the
// quit channel and calling the Fini method are cancellation
// signals. When a cancellation signal is received the method
// returns after closing ch.
//
// This method should be used as a goroutine.
//
// NOTE: PollEvent should not be called while this method is running.
ChannelEvents(ch chan<- Event, quit <-chan struct{})

// PollEvent waits for events to arrive. Main application loops
Expand Down

0 comments on commit 6224fe8

Please sign in to comment.