Documentation
Could you write documentation (guide, etc) for implementation SocketIOServer listeners?
Have you seen at demo project code examples? What kind of description is needed?
Yes, I see the demo project. What is purpose of AckRequest and AckCallback? What its lifecycle?
I put some comments right in sources of those classes. Does it help?
Additionally interface documentation for things like JsonSupport. The expectations for namespaces and arrays are unclear. What are the expectations of lifecycle and how are they expected to scale? It appears that a JsonSupport instance is effectively meant to be request scoped but that happens as a detail of implementation in the default JacksonJsonSupport.
Also I couldn't find any info on how to make SpringAnnotationScanner work. Declaring it like this, does nothing:
@Bean(destroyMethod = "stop")
def socketServer() {
new SocketIOServer(new com.corundumstudio.socketio.Configuration())
}
@Bean
def socketIoConfigurer() {
new SpringAnnotationScanner(socketServer())
}
@AlexCzar i have almost the same config as you wrote and it works. Is socketServer available as bean?
Yes it is. For now I add all the handler in the static void main() like this:
def app = SpringApplication.run(Bootstrap, args)
def ioServer = app.getBean(SocketIOServer)
ioServer.addListeners(MyHandler)
ioServer.start()
This works, but having to remember to edit main every time I add a new handler class is kinda lame.
By the way, I tried defining handler as a @Service, a @Component and as a @Bean. The problem is the same for all three.