def join(limit=nil)
      # try directly get result
      if !alive? || limit.nil? || limit <= 0
        # call value to raise error
        value
        return self
      end

      # return to current beam if beam done within time limit
      origin_parent = parent
      self.parent = Beam.current
      # set a transfer back timer
      timer = LightIO::Watchers::Timer.new(limit)
      timer.set_callback do
        if alive?
          caller_beam = parent
          # resume to origin parent
          self.parent = origin_parent
          caller_beam.transfer
        end
      end
      ioloop.add_timer(timer)
      ioloop.transfer

      if alive?
        nil
      else
        check_and_raise_error
        self
      end
    end
def join(limit=nil)
      # try directly get result
      if !alive? || limit.nil? || limit <= 0
        # call value to raise error
        value
        return self
      end

      # return to current beam if beam done within time limit
      origin_parent = parent
      self.parent = Beam.current
      # set a transfer back timer
      timer = LightIO::Watchers::Timer.new(limit)
      timer.set_callback do
        if alive?
          caller_beam = parent
          # resume to origin parent
          self.parent = origin_parent
          caller_beam.transfer
        end
      end
      ioloop.add_timer(timer)
      ioloop.transfer

      if alive?
        nil
      else
        check_and_raise_error
        self
      end
    end
Block and wait beam dead

 @param [Numeric]  limit wait limit seconds if limit > 0, return nil if beam still alive, else return beam self
 @return [Beam, nil]