Reputation: 315
Should we create a new verticle for WebSocket as it might be used in a heavy operation? What are the performance impact of not creating WebSocket verticle and handle WebSocket requests in the same rest verticle
Upvotes: 0
Views: 232
Reputation: 17691
There are a couple of concepts mixed together there, I think.
By default, your WebSocket handler will run on the event loop. Even if you extract it to a verticle, by default it will still run on the event loop. You can run it on a worker verticle, but you shouldn't, because WebSockets shouldn't be a long running operation.
Instead, use Event Bus to send messages from your WebSockets handler to worker verticles that will do the "heavy operations" for you. That will allow your application to scale well.
Upvotes: 1