- Mojo::IOLoop
6. Special considerations
-- Exceptions in event-driven code.
-- SIGPIPE, EPIPE - might have more to do with long-lived processes rather than
+X Exceptions in event-driven code.
+X SIGPIPE, EPIPE - might have more to do with long-lived processes rather than
just event-driven programming, but still something to watch out for...
-- You should almost always check the return code of your syscalls to see if they succeeded or not.
+X You should almost always check the return code of your syscalls to see if they succeeded or not.
7. Promises:
- Future
---
class: center, middle
+## `SIGPIPE`
+
+---
+class: sigpipe
+## `SIGPIPE`
+
+- Sent to your program when it writes to a pipe that was closed.
+
+--
+- Default signal handler terminates the program.
+
+---
+class: ex-sigpipe
+
+## Solution: Ignore `SIGPIPE`
+
+```perl
+$SIG{PIPE} = 'IGNORE';
+```
+
+???
+Some event loops do this for you.
+
+--
+.big[
+Look for `EPIPE` from syscalls (like [`write`](http://man.he.net/man2/write)) instead.
+
+(You *are* checking return codes from your system calls... right?)
+]
+
+---
+class: center, middle
+
## Use [`Future::AsyncAwait`](https://metacpan.org/pod/Future::AsyncAwait).
???