-
Notifications
You must be signed in to change notification settings - Fork 10
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
Improve Interaction Handling #24
Comments
Actually, better yet, instead of creating a Task Supervisor, maybe the caller process spawned by nostrum can run the |
Hello!
I think this is the preferable way to go. Nostrum's consumer spawns a process for each gateway event, so this seems like the logical step to me. That way, the interactor is also harder to overload (for very big bots) if all it does is provide synchronized access to the storage. Perhaps we should rename it in that case, though? What do you think? |
Awesome! I can work on making this change then. I agree with renaming Do you think we should rename |
Hmm, I'm thinking that since application commands are pretty fleshed out at this point and a lot of bots are using them, making Nosedrum simpler to use for the recommended path (implementing commands with slash commands) seems logical to me, especially because application commands have all the fancy features like input validation and so on built in (a lot of nosedrum is basically just built for this). So I think instead of moving these modules under |
Ohh gotcha, that makes sense. I can definitely move the modules around in the PR then! |
Hi @jchristgit! A month or two ago someone in the nostrum discord mentioned a design flaw with how Application Commands are run, and indeed I think I was a bit naive when I wrote this part of
Nosedrum.Interactor.Dispatcher
specifically:Currently, if a user's
command/1
callback errors, it looks like it takes down the dispatcher with it.I think it would be better to run the body of that
with
inside aTask
, probably using aTask.Supervisor
- and more specificallyTask.Supervisor.start_child/5
. Although, I see in #20 you might care about knowing the success of the response, in which case maybeTask.Supervisor.async_nolink/5
would be better? What do you think? Any other approach you would recommend to make the dispatcher more resilient to crashes caused by running a user's application command?I have some free time over the next week and could have a PR up soon if this approach looks good to you :)
The text was updated successfully, but these errors were encountered: