celluloid/celluloid — pull request #325 by halorgium (2013-09-25 14:45:52+00:00)
Title: Linking actors can cause tasks to be created incorrectly

When we are linking, we defer the handling of `SystemEvents`.
The problem is that if we receive an `ExitEvent` while we are linking, we will handle it while we are still running the parent method call.

I propose that we keep the SystemEvents until the event loop is given back control.
This is what would happen if that `ExitEvent` is delayed until the linking is complete.

We could reinsert the `SystemEvent` messages back into the mailbox.

/cc mperham/sidekiq#1161