netty-socketio icon indicating copy to clipboard operation
netty-socketio copied to clipboard

Documentation

Open masterDen opened this issue 14 years ago • 7 comments

Could you write documentation (guide, etc) for implementation SocketIOServer listeners?

masterDen avatar Oct 24 '12 16:10 masterDen

Have you seen at demo project code examples? What kind of description is needed?

mrniko avatar Oct 25 '12 05:10 mrniko

Yes, I see the demo project. What is purpose of AckRequest and AckCallback? What its lifecycle?

masterDen avatar Oct 28 '12 13:10 masterDen

I put some comments right in sources of those classes. Does it help?

mrniko avatar Nov 08 '12 17:11 mrniko

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.

niffrig avatar Feb 10 '15 13:02 niffrig

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 avatar Feb 16 '15 12:02 AlexCzar

@AlexCzar i have almost the same config as you wrote and it works. Is socketServer available as bean?

mrniko avatar Feb 16 '15 13:02 mrniko

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.

AlexCzar avatar Feb 17 '15 08:02 AlexCzar