https://github.com/civilcode/beam-shutdown
Demonstrates the shutdown of the beam
https://github.com/civilcode/beam-shutdown
Last synced: over 1 year ago
JSON representation
Demonstrates the shutdown of the beam
- Host: GitHub
- URL: https://github.com/civilcode/beam-shutdown
- Owner: civilcode
- Created: 2018-04-25T12:46:42.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-25T12:56:50.000Z (about 8 years ago)
- Last Synced: 2025-01-26T12:41:33.656Z (over 1 year ago)
- Language: Elixir
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Umb
This is an umbrella containing 2 applications: A and B.
It's been created to check what happens when we send `SIGTERM` to the `BEAM`.
Here, we've setup application A, which depends on application B.
Both applications contains long running processes setup using GenServer.
We want to delay shutting down of the application A and give it time to clean up. To do that we
setup shutdown timeout, trap exit and setup `terminate` callback to be called on shutdown. Part of the
clean up step is to send message to application B.
Result: we successfully receive an answer.
To send `SIGTERM` signal:
```
ps ax | grep beam
kill -s TERM beam_pid
```