That's fine. If you leave it change the type to boolean(). But I'd probably just change the guard test to check if the connection is undefined. In that clause, then have a case on queue:empty. Might make it easier to handle the dropped message as well.