The chaingun is a chain driven weapon mounted on some APC's and AFV's in the armouries of certain countries.
The chain has a small block of metal on it, when the chain reaches a certain point, it drives the bolt of the weapon forward, chambering a round
The chain then moves through its second quarter, ensuring the round is fully chambered before the striker hits the base of the round and the round leaves the chamber.
The empty case is removed during the third quarter, and the rotational chamber is rotated (oddly enough) so a new round is introduced to the now rearward working parts of the weapon.
During the fourth quarter, the round begins to be removed from the chamber and a new round is prepared for chambering.
As the working parts move forward, a new round is chambered and the empty case is pushed up an ejection port in the barrel of the weapon.
This is one cycle and in a well designed chaingun can happen several times a second, leading to an insane fire rate.