My situation: I want to send one last round of messages (notifying about shutdown of the service) out of all my open cowboy websocket connections when my application is shut down (e.g. via SIGTERM).
From the documentation I get that Application.pre_stop should be used for this. Now what I’m concerned about is: If I use “cast” style messages here to send from my application process to the websocket processes that in turn send out the shutdown notices, are all messages actually always going to “make it out in time”? Or is it possible that the shutdown of the application somehow overtakes my final messages and I’d better used “call” style messaging to block in the pre_stop function until I got notice that all messages were sent?