A rotary compressor or pump has a cam with a plurality of lobes mechanically engaging a plurality of pistons. The lobes urge the pistons from an open to a closed position within a piston void, the closure of the piston into the piston void creating compression or pressure of a material. Each piston is linked to another piston, and as one piston is closed by the cam, the other piston is opened by a linkage.