implement a msgqueue