Skip to content

Kitto.Web.Engine

Request-pipeline engine for KittoX. TKWebEngine is the root route that orchestrates the whole request lifecycle: it ensures/creates the per-user session, sets up the thread-local request/response objects, dispatches to its child routes, manages session cookies and cleanup, and fires the session start/end events. Hosted by TKWebServer (Indy) or the WebBroker bridge (ISAPI/Apache).

TKWebEngine class

Kitto engine route. Handles sub-routes (such as the application route) and manages a list of active sessions. Also keeps the current session in TKWebSession updated. It is normally embedded in a TKWebServer but can be used as-is (for example inside an ISAPI dll or Apache module).

pascal
property Active: Boolean read FActive write SetActive;

Activates/deactivates the engine (starts/stops the session cleanup thread).

pascal
property Charset: string read FCharset;

The response charset used by the engine (from Config, default utf-8).

pascal
function GetSessionInfos: TArray<TKWebSessionInfo>;

Snapshot of the active sessions for diagnostics/monitoring. Returns copied values, never session objects: see TKWebSessionInfo for why.

pascal
function SetSessionDisplayName(const ASessionId, ADisplayName: string): Boolean;

Renames one session, resolved by id under the sessions lock.

pascal
property OnSessionStart: TKWebEngineSessionProc read FOnSessionStart write FOnSessionStart;

Fired when a new session has started.

This event is queued in the main thread's context (fired through TThread.Queue).

pascal
property OnSessionEnd: TKWebEngineSessionProc read FOnSessionEnd write FOnSessionEnd;

Fired just before a session ends, either prematurely or when cleaned up due to timeout.

This event is called in the main thread's context (fired through TThread.Queue).

pascal
function SimpleHandleRequest(const ARequest: TWebRequest;

Manufactures all kitto objects (url, request and response) base on the provided Webbroken request and response objects, and then calls HandleRequest and optionally disposes of the passed objects. Useful as a HandleRequest wrapper to be called from the Indy Kitto server or the ISAPI/Apache implementation or elsewhere. <param AOwnsObjects> True if ARequest and AResponse should be destroyed before returning. </param>

Released under Apache License, Version 2.0.