Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should esp:task_wdt_user_handle() be a resource? #1205

Open
pguyot opened this issue Jun 22, 2024 · 0 comments
Open

Should esp:task_wdt_user_handle() be a resource? #1205

pguyot opened this issue Jun 22, 2024 · 0 comments

Comments

@pguyot
Copy link
Collaborator

pguyot commented Jun 22, 2024

If esp:task_wdt_user_handle() is garbage collected, esp:task_wdt_reset_user/1 could not ever be called.

Should it be a resource that would delete itself when garbage collected?

This is debatable as having it as a resource implies that code that means to never call esp:task_wdt_reset_user/1, because it shall reboot or deep sleep before it is triggered, should keep a reference somehow.

See for example in la_machine:run/0, I keep a reference and unconfigure watchdog just before deep sleeping, but if we specified esp:task_wdt_user_handle() is not a resource, I could just let the binary be garbage collected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant