actix
actix copied to clipboard
Question: How to wait for an event on actor startup?
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?
Two ideas:
- Use another actor to spawn the actor that manages the MQTT server, that second actor has an handler for the database connection message.
- In the actor, make the managed server and option and spawn in the handler of the database connection message