Deferred callback execution based on RAII