Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Message to isolate getting lost #40

Open
yashhema opened this issue Mar 6, 2023 · 3 comments
Open

First Message to isolate getting lost #40

yashhema opened this issue Mar 6, 2023 · 3 comments

Comments

@yashhema
Copy link

yashhema commented Mar 6, 2023

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.

@deakjahn
Copy link
Owner

deakjahn commented Mar 7, 2023

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

@yashhema
Copy link
Author

yashhema commented Mar 8, 2023

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

@deakjahn
Copy link
Owner

deakjahn commented Mar 8, 2023

As the comment in the code says:

/// If the function argument [onInitialized] is specified, it will be called
/// once communication channels have been established, meaning that the
/// [HandledIsolate] instance is ready to send and receive data.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants