swap_ack implemented with controllable queue size

Fixes #29
It is basically an improved version of #57