implement RPOPLPUSH and BRPOPLPUSH