diff --git a/include/uhdk.h b/include/uhdk.h index b5c142d..4eee811 100644 --- a/include/uhdk.h +++ b/include/uhdk.h @@ -218,6 +218,17 @@ enum { * no tag and produces no completion. Private native IDs are never reused. * Cancellation is best effort; an operation already committed may succeed. * Closing a session early abandons undelivered results and drains internal work. + * + * Component lifetime pattern: the application assigns dedicated tags to reusable + * components (for example, a clipboard tag passed to a UI backend at init). + * All components share the session's tag namespace; use separate tags for requests + * that may overlap. Keep each tag assigned to its component while it is alive. + * If a component is destroyed with a request pending, its owner must consume or + * ignore the eventual REQUEST_DONE before assigning that tag to a replacement. + * Cancelling the request does not release the tag or remove its completion. + * This prevents a replacement component from consuming its predecessor's result. + * Result payloads are borrowed until the next valid next_frame call or close; + * copy data or retain retainable references before keeping them beyond that point. */ typedef struct uhdk_event uhdk_event; typedef struct uhdk_event_list {