Skip to content

doawoo/evac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Evac

Hex.pm

Requirements

  • Elixir 1.12+

What Is It?

Evac is a simple C NIF for Elixir/Erlang that catches SIGINT.

The API is incredibly simple:

# Call the setup function with the PID you want to receive the `'SIGINT'` message...
# We'll use self() for now...
Evac.setup(self())

# Now if the VM process is sent the SIGINT message (Like from pressing Ctrl-C)
# we can do something with it

receive do
  'SIGINT' ->
    IO.puts("Got Interrupt Signal!")
    System.halt(0)
end

About

A simple way to catch SIGINT in Elixir

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published