This PR adds support for mounting WebSocket handler classes on URLs.
The API call essentially mirrors its Java counterpart. It takes a URL and a class containing WebSocket handler methods.
In addition, webSocketIdleTimeoutMillis has also been implemented, which, like webSocket, works exactly like the Java version.
The examples under src/test/ have been updated and a sample handler class has been added.
Usage:
// Attach a WebSocket handler to a Spark instance
val http = ignite()
http.webSocket("/ws", MyTotallyImplementedWebSocketHandler::class)
// Make connections time out after 30 seconds with no activity
http.webSocketIdleTimeoutMillis(30000)
// Attach a WebSocket handler to a static Spark environment
webSocket("/ws", MyTotallyImplementedWebSocketHandler::class)
// Set the inactivity timeout to 30 seconds
webSocketIdleTimeoutMillis(30000)
This PR adds support for mounting WebSocket handler classes on URLs.
The API call essentially mirrors its Java counterpart. It takes a URL and a class containing WebSocket handler methods.
In addition,
webSocketIdleTimeoutMillis
has also been implemented, which, likewebSocket
, works exactly like the Java version.The examples under src/test/ have been updated and a sample handler class has been added.
Usage:
Related to #11.