documentation more consistent
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
@defmodule{racket-webview/internals}
|
||||
|
||||
@title{Qt WebView Backend Architecture}
|
||||
@title[#:tag "rktwebviewqt-internals"]{Qt WebView Backend Architecture}
|
||||
@author[@author+email["Hans Dijkema" "hans@dijkewijk.nl"]]
|
||||
|
||||
@section{Overview}
|
||||
@section[#:tag "rktwebviewqt-internals-overview"]{Overview}
|
||||
|
||||
The runtime consists of two processes. The Racket process owns the public API,
|
||||
contexts used by the local HTTPS server, handle wrappers, and user callbacks.
|
||||
@@ -15,7 +15,7 @@ The helper process @tt{rktwebview_prg} owns @tt{QApplication}, Qt widgets,
|
||||
The processes communicate through standard pipes. There is no shared library,
|
||||
shared-memory queue, or callback from native code into the Racket runtime.
|
||||
|
||||
@section{Standard Streams}
|
||||
@section[#:tag "rktwebviewqt-internals-standard-streams"]{Standard Streams}
|
||||
|
||||
The streams have fixed roles:
|
||||
|
||||
@@ -28,7 +28,7 @@ Messages on stdin and stdout are compact UTF-8 JSON objects, one object per
|
||||
line. Stdout must not contain ordinary logging because the Racket protocol
|
||||
reader treats every value there as a protocol record.
|
||||
|
||||
@section{Protocol Compatibility}
|
||||
@section[#:tag "rktwebviewqt-internals-protocol-compatibility"]{Protocol Compatibility}
|
||||
|
||||
The command identifiers in @tt{rkt_protocol.h} and the JSON objects used as
|
||||
command payloads are unchanged. The process transport adds an outer message
|
||||
@@ -45,7 +45,7 @@ A corresponding result has this form:
|
||||
The request identifier prevents concurrent calls from consuming each other's
|
||||
results. It is not visible in the public API.
|
||||
|
||||
@section{Command Execution}
|
||||
@section[#:tag "rktwebviewqt-internals-command-execution"]{Command Execution}
|
||||
|
||||
A Racket caller registers a private response channel, writes a command while
|
||||
holding the transport write lock, and waits on that channel.
|
||||
@@ -58,7 +58,7 @@ result record to stdout.
|
||||
The Racket stdout reader is the only thread that reads protocol output. It uses
|
||||
the request identifier to forward each result to the correct waiting caller.
|
||||
|
||||
@section{Event Delivery}
|
||||
@section[#:tag "rktwebviewqt-internals-event-delivery"]{Event Delivery}
|
||||
|
||||
Qt events remain the original JSON strings. The Qt callback converts them only
|
||||
into this transport record:
|
||||
@@ -75,7 +75,7 @@ closure. Qt writes the @tt{"closed"} event before the result of the close comman
|
||||
The handle can be removed immediately after the result reaches its caller, but
|
||||
the already captured callback still receives the event.
|
||||
|
||||
@section{Contexts and Handles}
|
||||
@section[#:tag "rktwebviewqt-internals-contexts-and-handles"]{Contexts and Handles}
|
||||
|
||||
A context corresponds to a @tt{QWebEngineProfile} and is identified by an
|
||||
integer. A webview or tray icon is also identified by an integer handle. Only
|
||||
@@ -84,7 +84,7 @@ these numbers cross the process boundary; Qt object pointers never do.
|
||||
The existing Racket @tt{rkt-wv} structure is retained so the higher layers do
|
||||
not need to change.
|
||||
|
||||
@section{Lifecycle and Failure Handling}
|
||||
@section[#:tag "rktwebviewqt-internals-lifecycle-and-failure-handling"]{Lifecycle and Failure Handling}
|
||||
|
||||
The backend writes a protocol-version handshake after initialization. Racket
|
||||
waits for this handshake before sending application commands.
|
||||
@@ -100,14 +100,14 @@ loop. This replaces the former shared-memory alive and alive-ack queues.
|
||||
If stdout closes unexpectedly, Racket marks all handles invalid and delivers an
|
||||
exception to every command still waiting for a result.
|
||||
|
||||
@section{Logging}
|
||||
@section[#:tag "rktwebviewqt-internals-logging"]{Logging}
|
||||
|
||||
The Qt backend writes its existing log messages to stderr. Racket forwards that
|
||||
stream to its current error port. The @racket[rkt-webview-info] result reports
|
||||
@tt{"stderr"} as the backend log destination and retains zero-valued
|
||||
shared-memory metrics for compatibility with callers that display those fields.
|
||||
|
||||
@section{Development Override}
|
||||
@section[#:tag "rktwebviewqt-internals-development-override"]{Development Override}
|
||||
|
||||
Setting @tt{RKT_WEBVIEW_PRG} to a backend executable bypasses the installed
|
||||
release directory. This makes it possible to test a newly compiled backend
|
||||
|
||||
Reference in New Issue
Block a user