Provide an API similar to what is in socket.io Javascript implementation. something like on('message'. handler) Look at FSM API in akka. (Important: Socket.io doesn't need FSM)