public void addServerReadyConsumer ( Consumer < Server > consumer ) { synchronized ( readyConsumers ) { if ( ready ) { consumer . accept ( this ) ; } else { readyConsumers . add ( consumer ) ; } } }
Adds a consumer which will be informed once the server is ready . If the server is already ready it will immediately call the consumer otherwise it will be called from the websocket reading thread .