concurrente función automática con cierre