File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
book/listings/main_event_loop Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ fn build_ui(app: &Application) {
29
29
. build ( ) ;
30
30
31
31
// ANCHOR: callback
32
- let ( sender, receiver) = async_channel:: unbounded ( ) ;
32
+ // Create channel that can hold at most 1 message at a time
33
+ let ( sender, receiver) = async_channel:: bounded ( 1 ) ;
33
34
// Connect to "clicked" signal of `button`
34
35
button. connect_clicked ( move |_| {
35
36
let sender = sender. clone ( ) ;
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ fn build_ui(app: &Application) {
26
26
. build ( ) ;
27
27
28
28
// ANCHOR: callback
29
- let ( sender, receiver) = async_channel:: unbounded ( ) ;
29
+ // Create channel that can hold at most 1 message at a time
30
+ let ( sender, receiver) = async_channel:: bounded ( 1 ) ;
30
31
// Connect to "clicked" signal of `button`
31
32
button. connect_clicked ( move |_| {
32
33
let main_context = MainContext :: default ( ) ;
You can’t perform that action at this time.
0 commit comments