TsgcHTTP2Client › Properties › NotifyEvents
Steuert, wie HTTP/2-Ereignisse an den Haupt-Thread verteilt werden.
property NotifyEvents: TwsNotifyEvent read FNotifyEvents write SetNotifyEvents;
neAsynchronous
Drei Modi sind verfügbar: neAsynchronous (Standard) stellt HTTP/2-Ereignisse in eine Queue und synchronisiert sie asynchron mit dem Hauptthread; neSynchronous blockiert den Verbindungsthread, bis der Hauptthread das Ereignis verarbeitet hat; neNoSync löst Ereignisse direkt im Verbindungsthread aus, was schneller und besser für Konsolen- oder Dienstanwendungen geeignet ist, aber erfordert, dass der Ereignishandler-Code threadsicher ist.
oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.NotifyEvents := neSynchronous;