handle_poll (God::Task)

    # File lib/god/task.rb, line 312
        def handle_poll(condition)
          # lookup metric
          metric = self.directory[condition]

          # run the test
          result = condition.test

          # log
          messages = self.log_line(self, metric, condition, result)

          # notify
          if condition.notify && self.trigger?(metric, result)
            self.notify(condition, messages.last)
          end

          # after-condition
          condition.after

          # get the destination
          dest =
          if result && condition.transition
            # condition override
            condition.transition
          else
            # regular
            metric.destination && metric.destination[result]
          end

          # transition or reschedule
          if dest
            # transition
            begin
              self.move(dest)
            rescue EventRegistrationFailedError
              msg = watch.name + ' Event registration failed, moving back to previous state'
              applog(watch, :info, msg)

              dest = watch.state
              retry
            end
          else
            # reschedule
            self.driver.schedule(condition)
          end
        end