getContentIfNotHandled
Returns the content if it hasn't been handled yet, then marks it as handled.
This is the primary way to consume the event. It guarantees that the content is returned exactly once, even if called from multiple threads concurrently.
Usage Example
val event = OneTimeEvent("Error occurred")
val content1 = event.getContentIfNotHandled() // Returns "Error occurred"
val content2 = event.getContentIfNotHandled() // Returns null (already handled)Content copied to clipboard
Return
The event content on first call, null on subsequent calls.