TsgcHTTP2Client › Properties › NotifyEvents
Controls how HTTP/2 events are dispatched to the main thread.
property NotifyEvents: TwsNotifyEvent read FNotifyEvents write SetNotifyEvents;
neAsynchronous
Three modes are available: neAsynchronous (default) queues HTTP/2 events and synchronises them with the main thread asynchronously; neSynchronous blocks the connection thread until the main thread has processed the event; neNoSync fires events directly on the connection thread, which is faster and better suited for console or service applications but requires the event handler code to be thread-safe.
oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.NotifyEvents := neSynchronous;