Skip to content

Commit

Permalink
Break loop when channel is closed (ratatui-org#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
MMitsuha committed Mar 3, 2024
1 parent bf700d7 commit c979e6f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions simple-async/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ impl EventHandler {
let tick_delay = tick.tick();
let crossterm_event = reader.next().fuse();
tokio::select! {
_ = _sender.closed() => {
break;
}
_ = tick_delay => {
_sender.send(Event::Tick).unwrap();
}
Expand Down

0 comments on commit c979e6f

Please sign in to comment.