wait_for_messages will block forever if parameters are not given