def handlePause(infoHash, value)
      torrentData = @torrentData[infoHash]
      if ! torrentData
        @logger.warn "Asked to pause a non-existent torrent #{QuartzTorrent.bytesToHex(infoHash)}"
        return
      end

      return if torrentData.paused == value

      torrentData.paused = value

      if !value
        # On unpause, queue the torrent since there might not be room for it to run.
        # Make sure it goes to the head of the queue.
        queue(torrentData, :unshift)
      end

      setFrozen infoHash, value if ! torrentData.queued

      dequeue
    end
def handlePause(infoHash, value)
      torrentData = @torrentData[infoHash]
      if ! torrentData
        @logger.warn "Asked to pause a non-existent torrent #{QuartzTorrent.bytesToHex(infoHash)}"
        return
      end

      return if torrentData.paused == value

      torrentData.paused = value

      if !value
        # On unpause, queue the torrent since there might not be room for it to run.
        # Make sure it goes to the head of the queue.
        queue(torrentData, :unshift)
      end

      setFrozen infoHash, value if ! torrentData.queued

      dequeue
    end
Pause or unpause a torrent that we are downloading.