Replies: 1 comment 1 reply
-
See the docs of You should create the channels in the closure, rather than creating them before the application starts. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Apologies if this is kind of a basic problem or of this is the wrong place to ask. It looks like #1029 is asking a very similar question, but I'm not sure I understand the ultimate answer to the problem.
The gist of my problem is that I'm trying to create an
Application
that continuously checks a channel (currently looking at crossbeam, but I have no particular preference) for data pulled from a scientific camera in another thread and displays it in a heatmap. I've got the display part working withplotters_iced
, but it's the channel part that I'm stuck on.My first try was to initialize my
Application
with the channel receiver and useiced::time::every
to accomplish the main data pulling loop, but I can't capture the receiver as a field of the struct implementingApplication
. I also took a look aticed::subscription::unfold
, but this is my first foray into any sort of parallelism and I have to say I really don't understand it well yet.So what's the preferred or most convenient way to do something like this? My original plan is to have this
Application
run in its own thread and have another thread handle the actual data acquisition (because there's some other processing that I'd like to have happen outside of this context). After reading the other post I linked above, I'm still not sure how the sending side of the channel can ever be used from outside theApplication
/Subscription
.Beta Was this translation helpful? Give feedback.
All reactions