In long recoil designs the bolt and barrel usually have
independent return springs.
Once they reach the rearward
end of their extention, the bolt engages a catch and
extraction begins.
The barrel freely returns to its forward
position, clearing the cartridge from the barrel's chamber and
allowing it to eject.
In closed bolt designs the bolt then moves forward
chambering a fresh round, ready for the next shot.
Long recoil is often found in large naval guns or artillery pieces. In small arms it's quite rare, one notable exception being the Browning Automatic shotgun. One might wonder if allowing the barrel to move from shot to shot would be a detriment to precision. Apparently as long as the barrel is designed to return to position consistently (and actually does) this is not a problem.