-
Notifications
You must be signed in to change notification settings - Fork 160
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
Destructors aren't run for detached tasks #294
Comments
Tasks spawned with |
It looks like when I don't detach the task, the Looks like I have to |
This is to be expected. The executor in this case is The intended solution is to create your own executor. |
Ah, okay. I can PR the docs change for |
Yes, that would be appreciated. |
I have an application starting detached tasks to handle each TCP connection, and this application seems to be leaking memory as a result of that, might this be the reason? I am a little confused to how i should handle the destruction using a custom executor? Do you have any examples on how to do that properly? |
@notgull Is it ok that i ask this here even thought the issue is closed? |
It's always okay to ask. I've just been distracted for the past week or so.
If you have an application like this it's probably already time to consider moving away from |
Excuse me, what should in such case be used instead? |
I noticed today that when I
.detach()
a task, itsdrop()
is never run.Is this to be expected?
If yes, this should probably be documented in
Task::detach()
docs...Using smol v1.3.0.
The text was updated successfully, but these errors were encountered: