code: public void setPieceDeadline(int index, int deadline, deadline_flags_t flags) {
          th.set_piece_deadline(index, deadline, flags);
      }
docs: This function sets or resets the deadline associated with a specific
  piece index (``index``). libtorrent will attempt to download this
  entire piece before the deadline expires. This is not necessarily
  possible, but pieces with a more recent deadline will always be
  prioritized over pieces with a deadline further ahead in time. The
  deadline (and flags) of a piece can be changed by calling this
  function again.
  <p>
  The ``flags`` parameter can be used to ask libtorrent to send an alert
  once the piece has been downloaded, by passing alert_when_available.
  When set, the read_piece_alert alert will be delivered, with the piece
  data, when it's downloaded.
  <p>
  If the piece is already downloaded when this call is made, nothing
  happens, unless the alert_when_available flag is set, in which case it
  will do the same thing as calling read_piece() for ``index``.
  
  @param index
  @param deadline
  @param flags