def when(*args)
      return self.next{[]} if args.empty?
      args = args.flatten
      args.each_with_index{|d, index|
        unless d.is_a?(Deferredable::Chainable) || d.is_a?(Deferredable::Awaitable)
          raise TypeError, "Argument #{index} of Deferred.when must be #{Deferredable::Chainable}, but given #{d.class}"
        end
        if d.respond_to?(:has_child?) && d.has_child?
          raise "Already assigned child for argument #{index}"
        end
      }
      defer, *follow = *args
      defer.next{|res|
        [res, *follow.map{|d| +d }]
      }
    end
def when(*args)
      return self.next{[]} if args.empty?
      args = args.flatten
      args.each_with_index{|d, index|
        unless d.is_a?(Deferredable::Chainable) || d.is_a?(Deferredable::Awaitable)
          raise TypeError, "Argument #{index} of Deferred.when must be #{Deferredable::Chainable}, but given #{d.class}"
        end
        if d.respond_to?(:has_child?) && d.has_child?
          raise "Already assigned child for argument #{index}"
        end
      }
      defer, *follow = *args
      defer.next{|res|
        [res, *follow.map{|d| +d }]
      }
    end
複数のdeferredを引数に取って、それら全ての実行が終了したら、
 その結果を引数の順番通りに格納したArrayを引数に呼ばれるDeferredを返す。
 引数のDeferredが一つでも失敗するとこのメソッドの返すDeferredも失敗する。
 ==== Args
 [*args] 終了を待つDeferredオブジェクト
 ==== Return
 Deferred