def fallback_to(fallback)
      promise = Promise.new(@options)
      on_complete_match do |m|
        m.success { |value| promise.complete!(value) }
        m.failure do |error|
          fallback.on_complete_match do |m2|
            m2.success { |value| promise.complete!(value) }
            m2.failure { promise.failure!(error) }
          end
        end
      end

      promise.to_future
    end
def fallback_to(fallback)
      promise = Promise.new(@options)
      on_complete_match do |m|
        m.success { |value| promise.complete!(value) }
        m.failure do |error|
          fallback.on_complete_match do |m2|
            m2.success { |value| promise.complete!(value) }
            m2.failure { promise.failure!(error) }
          end
        end
      end

      promise.to_future
    end
Creates a new future which holds the result of +self+ future if it
 was completed successfully, or, if not, the result of the +fallback+
 future if +fallback+ is completed successfully.
 If both futures are failed, the resulting future holds the error
 object of the first future.

 @param fallback [Fear::Future]
 @return [Fear::Future]

 @example
   f = Fear.future { fail 'error' }
   g = Fear.future { 5 }
   f.fallback_to(g) # evaluates to 5

 rubocop: disable Metrics/MethodLength