def cleanup(exit_event)
      # !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
      # rubocop:disable Style/GlobalVars
      Celluloid::Probe.actor_died(self) if $CELLULOID_MONITORING
      # rubocop:enable Style/GlobalVars

      @mailbox.shutdown
      @links.each do |actor|
        actor.mailbox << exit_event if actor.mailbox.alive?
      end

      tasks.to_a.each do |task|
        begin
          task.terminate
        rescue DeadTaskError
          # TODO: not tested (failed on Travis)
        end
      end
    rescue => ex
      # TODO: metadata
      Internals::Logger.crash("CLEANUP CRASHED!", ex)
    end
def cleanup(exit_event)
      # !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
      # rubocop:disable Style/GlobalVars
      Celluloid::Probe.actor_died(self) if $CELLULOID_MONITORING
      # rubocop:enable Style/GlobalVars

      @mailbox.shutdown
      @links.each do |actor|
        actor.mailbox << exit_event if actor.mailbox.alive?
      end

      tasks.to_a.each do |task|
        begin
          task.terminate
        rescue DeadTaskError
          # TODO: not tested (failed on Travis)
        end
      end
    rescue => ex
      # TODO: metadata
      Internals::Logger.crash("CLEANUP CRASHED!", ex)
    end
Clean up after this actor