isolate_handler icon indicating copy to clipboard operation
isolate_handler copied to clipboard

First Message to isolate getting lost

Open yashhema opened this issue 2 years ago • 3 comments

Hello, Is there a way for us to check , that isolate is ready ; I mean one thing i have observed is that Isolate loop , doesnt recv the first message.

I have put in print statements , it never hits.

yashhema avatar Mar 06 '23 19:03 yashhema

Yes, onInitialized. Does it fire for you in the example app?

deakjahn avatar Mar 07 '23 11:03 deakjahn

Hello, OnInitialized -- the function runs in the isolate.

How can the main thread know isolate is ready , shall it wait for Isolate to send some message saying I am up regards

yashhema avatar Mar 08 '23 01:03 yashhema

As the comment in the code says:

https://github.com/deakjahn/isolate_handler/blob/a8bf383b90d18199ab36b448fe153ef9fe19986a/lib/src/handled_isolate.dart#L58-L60

So, either start the communication directly from this handler (the example does so), or if you need a constant way to check for it, use a boolean variable and set it true from this handler.

deakjahn avatar Mar 08 '23 11:03 deakjahn