Action queue
There is no queue for actions. It is possible to send one action in the middle of another action - this will probably cause the first action to get discarded. Instead, we should queue up the actions, only popping from the queue when the connection state is idle.