Skip to content

writing to a TextEditor from another thread #771

Answered by jrmoulton
permezel asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jrmoulton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants