Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1010 from samcv/signal
Show how to go from signal numbers to Signal objects to use with the signal method
  • Loading branch information
jonathanstowe committed Nov 14, 2016
2 parents d3f3d0c + 49fc78b commit 0ea8e00
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions doc/Type/Supply.pod6
Expand Up @@ -599,8 +599,15 @@ the supply. For example:
signal(SIGINT).tap( { say "Thank you for your attention"; exit 0 } );
would catch Control-C, thank you, and then exit. The list of supported
signals can be found by checking Signal::.keys (as you would any enum).
would catch Control-C, thank you, and then exit.
To go from a signal number to a Signal, you can do something like this:
signal(Signal(2)).tap( -> $sig { say "Received signal: $sig" } );
The list of supported signals can be found by checking Signal::.keys (as
you would any enum). For more details on how enums work see
L<enum|/language/typesystem#enum>.
=head2 method IO::Notification.watch-path
Expand Down

0 comments on commit 0ea8e00

Please sign in to comment.