The MOC7811 is a slotted interrupter module (datasheet attached). Presumably, you will have an optical disc in the slot that alternately blocks and transmits the IR light. How many holes depends on how many pulses per revolution you want - within the limitations of the interrupter.
Note that with one interrupter, you can only determine the number of pulses, not the direction of the optical disc. That takes 2 detectors.