def event_handler(event)
      case event.command
      when :shutdown
        shutdown_handler(event)
        @run = false
      when :perform
        perform_handler(event)
      else
        raise Workers::UnknownEventError, "Unhandled event (#{event.inspect})."
      end

      nil
    end
def event_handler(event)
      case event.command
      when :shutdown
        shutdown_handler(event)
        @run = false
      when :perform
        perform_handler(event)
      else
        raise Workers::UnknownEventError, "Unhandled event (#{event.inspect})."
      end

      nil
    end
Override this method to handle custom events.
 Make sure you call super(event) if want to built-in events to work.