lev.own

lev

own(resource) -> resource

Register a resource for auto-close when the current task completes

Registers resource for automatic cleanup when the current coroutine finishes (success or error). The resource must have a close() method. Returns the resource for chaining: local sock = lev.own(lev.connect(...)). No-op outside lev.run() or from non-spawned coroutines.