ManualMemoryPressureObserver
A MemoryPressureObserver whose signals are pushed with emit.
Used as the base of platform observers, on platforms without an OS signal (JVM desktop), and as a deterministic fake in tests. Thread-safe: listeners may be added, removed, and notified concurrently.
Inheritors
Properties
Link copied to clipboard
The most recently reported level, or MemoryPressureLevel.NORMAL if none has been reported.
Functions
Link copied to clipboard
Registers listener. Closing the returned handle unregisters it; closing it more than once is a no-op.
Link copied to clipboard
Records newLevel as currentLevel and notifies every registered listener in registration order.