The cash moves first and the commodity comes later. The buyer pays the price in full at the time of contract, and the seller becomes obligated to deliver the agreed commodity later.
Classically, the buyer is rabb-us-salam (رب السلم), the seller muslam ilayh (المسلم إليه), the advance price ra's-ul-mal (رأس المال), and the commodity muslam fih (المسلم فيه). For understanding the structure, the simple words buyer, seller, price and commodity are enough.