def initTorrent(torrentData)
      # If we already have the metainfo info for this torrent, we can begin checking the pieces. 
      # If we don't have the metainfo info then we need to get the metainfo first.
      if ! torrentData.info
        torrentData.info = MetainfoPieceState.downloaded(@baseDirectory, torrentData.infoHash)
      end

      if torrentData.info
        startCheckingPieces torrentData
      else
        # Request the metainfo from peers.
        torrentData.state = :downloading_metainfo

        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Downloading metainfo"

        # Schedule peer connection management. Recurring and immediate 
        torrentData.managePeersTimer = 
          @reactor.scheduleTimer(@managePeersPeriod, [:manage_peers, torrentData.infoHash], true, true)

        # Schedule a timer for requesting metadata pieces from peers.
        torrentData.metainfoRequestTimer = 
          @reactor.scheduleTimer(@requestBlocksPeriod, [:request_metadata_pieces, torrentData.infoHash], true, false)

        # Schedule checking for metainfo PieceManager results (including when piece reading completes)
        torrentData.checkMetadataPieceManagerTimer =
          @reactor.scheduleTimer(@requestBlocksPeriod, [:check_metadata_piece_manager, torrentData.infoHash], true, false)
      end
    end
def initTorrent(torrentData)
      # If we already have the metainfo info for this torrent, we can begin checking the pieces. 
      # If we don't have the metainfo info then we need to get the metainfo first.
      if ! torrentData.info
        torrentData.info = MetainfoPieceState.downloaded(@baseDirectory, torrentData.infoHash)
      end

      if torrentData.info
        startCheckingPieces torrentData
      else
        # Request the metainfo from peers.
        torrentData.state = :downloading_metainfo

        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Downloading metainfo"

        # Schedule peer connection management. Recurring and immediate 
        torrentData.managePeersTimer = 
          @reactor.scheduleTimer(@managePeersPeriod, [:manage_peers, torrentData.infoHash], true, true)

        # Schedule a timer for requesting metadata pieces from peers.
        torrentData.metainfoRequestTimer = 
          @reactor.scheduleTimer(@requestBlocksPeriod, [:request_metadata_pieces, torrentData.infoHash], true, false)

        # Schedule checking for metainfo PieceManager results (including when piece reading completes)
        torrentData.checkMetadataPieceManagerTimer =
          @reactor.scheduleTimer(@requestBlocksPeriod, [:check_metadata_piece_manager, torrentData.infoHash], true, false)
      end
    end
Take a torrent that is in the :initializing state and make it go.