-
I have a simple app and I want to use the text editor to display continuously updated information, as if on a terminal.
The created effect never fires. How do I tie the signal to the view? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
https://docs.rs/floem/latest/floem/ext_event/fn.create_signal_from_channel.html With feature flags you can also enable channels from tokio channels or from future streams. You need to write to a channel on another thread and have a signal receive it on the main thread. Signals shouldn't be able to be sent to other threads either as they are tied to the thread on which they are created so that code shouldn't have compiled either. Signals used to be !Send but that was removed at some point. I've just pushed a PR that makes signals !Send again. |
Beta Was this translation helpful? Give feedback.
https://docs.rs/floem/latest/floem/ext_event/fn.create_signal_from_channel.html
https://docs.rs/floem/latest/floem/ext_event/fn.update_signal_from_channel.html
With feature flags you can also enable channels from tokio channels or from future streams.
You need to write to a channel on another thread and have a signal receive it on the main thread.
Signals shouldn't be able to be sent to other threads either as they are tied to the thread on which they are created so that code shouldn't have compiled either. Signals used to be !Send but that was removed at some point. I've just pushed a PR that makes signals !Send again.