v0.32.0 0617278

runtime_activity.go RawHistoryFolder

1package port
2
3import "context"
4
5// RuntimeActivitySnapshot is an engine-neutral view of outstanding native
6// runtime work that must settle before the process may idle out. Counts only:
7// generations and acknowledgement correlation live with the implementation.
8type RuntimeActivitySnapshot struct {
9	// PendingCreations counts accepted browser creations not yet resolved
10	// through OnAfterCreated or a definitive failure.
11	PendingCreations int
12	// ActiveViews counts registered live views, including views whose
13	// native close has started but whose GTK teardown is outstanding.
14	ActiveViews int
15	// PendingCleanup counts native-closed views whose queued GTK
16	// bridge/popup cleanup has not completed.
17	PendingCleanup int
18	// ActiveDownloads counts downloads with a terminal event outstanding.
19	ActiveDownloads int
20}
21
22// Quiescent reports whether no native work is outstanding.
23func (s RuntimeActivitySnapshot) Quiescent() bool {
24	return s.PendingCreations == 0 && s.ActiveViews == 0 && s.PendingCleanup == 0 && s.ActiveDownloads == 0
25}
26
27// RuntimeActivity is the application-port boundary for native runtime
28// quiescence. The initial snapshot and subscription are race-safe and
29// sequenced: Subscribe delivers the current snapshot synchronously, then all
30// later transitions in order. Unsubscribe at shutdown.
31type RuntimeActivity interface {
32	Snapshot() RuntimeActivitySnapshot
33	Subscribe(func(RuntimeActivitySnapshot)) (unsubscribe func())
34}
35
36// PersistenceDrain is the narrow activity/drain boundary for persistence
37// owners whose saves cross the GTK/database boundary. Active covers pending
38// debounce, in-flight capture/execution, and unsettled terminal failure.
39// WaitSettled blocks until settled or ctx ends; it must never be called on
40// the GTK thread when capture dispatches there.
41type PersistenceDrain interface {
42	Active() bool
43	WaitSettled(ctx context.Context) error
44}
45
46// AdmissionBoundary is the admission/work-lease contract shared by the relay
47// listener and the shutdown/residency policy. Infrastructure provides the
48// implementation; application code depends only on this boundary.
49type AdmissionBoundary interface {
50	// Acquire takes one work lease, reporting false when admission is
51	// closed. Callers send the existing error response instead of
52	// acknowledging.
53	Acquire() bool
54	// Release returns one work lease on dispatch settlement.
55	Release()
56	// Close atomically stops admission; in-flight leases drain.
57	Close()
58	// Reopen resumes admission after an invalidated seal.
59	Reopen()
60	// Closed reports whether admission is stopped.
61	Closed() bool
62	// Active reports the number of held leases.
63	Active() int
64	// OnDrained registers a callback for every transition to zero leases.
65	// Callbacks run without the gate lock and must not reenter it.
66	OnDrained(func())
67	// WaitDrained blocks until no leases are held or ctx ends, reporting
68	// false on expiry so shutdown never waits forever.
69	WaitDrained(ctx context.Context) bool
70}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close