From 20ef2b292709910cd9017ca2e7566a2c7abb9f54 Mon Sep 17 00:00:00 2001 From: Sdogruyol Date: Fri, 18 Dec 2015 22:45:28 +0200 Subject: [PATCH] Add more documentation --- src/kemal/handler.cr | 4 +++- src/kemal/websocket_handler.cr | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kemal/handler.cr b/src/kemal/handler.cr index 2855a70..a28e21b 100644 --- a/src/kemal/handler.cr +++ b/src/kemal/handler.cr @@ -1,7 +1,9 @@ require "http/server" require "uri" -# Handles the routes +# Kemal::Handler is the main handler which handles all the HTTP requests. Routing, parsing, rendering e.g +# are done in this handler. + class Kemal::Handler < HTTP::Handler INSTANCE = new diff --git a/src/kemal/websocket_handler.cr b/src/kemal/websocket_handler.cr index e5e35ae..b9ba544 100644 --- a/src/kemal/websocket_handler.cr +++ b/src/kemal/websocket_handler.cr @@ -1,3 +1,6 @@ +# Kemal::WebsocketHandler is used for each define WebSocket route. +# For each WebSocket route a new handler is created and registered to global handlers. + class Kemal::WebsocketHandler < HTTP::WebSocketHandler def initialize(@path, &@proc : WebSocketSession ->) Kemal.config.add_ws_handler self