Replies: 2 comments 2 replies
-
Ok so I'm a bit of a moron as I needed to get the errors on But, I'm not a big fan that I am forced to try and send something to see if the sink is accepting values. Couldn't there be a more elegant way to check that? |
Beta Was this translation helpful? Give feedback.
0 replies
-
IIRC we do not have any yet, but a workaround may be, when you close stream in dart, also do a dart-to-rust function call to tell the rust side that rust should no longer send anything. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm a Rust dev trying out Flutter, and I'm trying to use Streams with FRB.
I use it to watch files in a folder in Rust, and send back objects to the Dart side that represent the current contents of the folder.
Code
Here is the rust generic code with some prints to see what's happening:
And here's how I was consuming it on the Flutter side:
Issue
The issue is that I realized that as the
sidebarSelectionProvider
, it starts a new Rust thread every time, and they all stay alive forever.I'm not entirely sure what happens to the streams on the Dart side, but to me it looks like at a given point there's a single one active.
Question
I don't see anything in the
sink: StreamSink<T>
that would let me see if the Flutter side is still listening to it.Am I doing something wrong in my code by creating new streams every time?
Because it is working technically, outside the fact that 5 minutes in I have 100 dead threads running.
Beta Was this translation helpful? Give feedback.
All reactions