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

Question: How to wait for an event on actor startup? #528

Open
LasseRosenow opened this issue Mar 22, 2022 · 1 comment
Open

Question: How to wait for an event on actor startup? #528

LasseRosenow opened this issue Mar 22, 2022 · 1 comment
Labels

Comments

@LasseRosenow
Copy link

LasseRosenow commented Mar 22, 2022

I have an Actor that sets up an MQTT Server, but I only want the server to start, after I received a Message DatabaseConnection.

What would be the recommended way to do this?

@Sytten
Copy link
Contributor

Sytten commented May 24, 2022

Two ideas:

  1. Use another actor to spawn the actor that manages the MQTT server, that second actor has an handler for the database connection message.
  2. In the actor, make the managed server and option and spawn in the handler of the database connection message

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

No branches or pull requests

3 participants