-
Notifications
You must be signed in to change notification settings - Fork 38
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
Un- and reload plugins with Deferreds #86
Conversation
Closing this in lieu of #87 |
hm, it seems like the new commit doesn't show up because you closed this @johnmaguire (don't know if you get notified of this either); you can check it out at afed1bb |
This looks pretty good. I made some comments now, and I'll play around with a little tonight. :) Not sure I want to merge this directly into master when we have this in a good state. I want to investigate what sort of work would need to be done to let plugin commands / event handlers return Deferreds, and maybe do that at the same time. If we implement Deferred support throughout Cardinal, I think it might justify a 2.1 release, but in that case, there's a couple other things I'd probably like to get done before releasing 2.1 (#46 really shouldn't be too hard, I just haven't gotten around to it, and it lays the groundwork for #61 and thus being able to implement other protocols). And since we're tying Cardinal to Twisted pretty heavily with this change (which I'm still a little uneasy about because as I've previously said, I was kinda going the other direction), it might cause me to re-examine the method in which I was going to implement secondary protocols. For example, theoretically a Slack protocol driver could be implemented as a Twisted protocol. But it also means I am set on Cardinal being a Twisted application, through-and-through which means other decisions:
I'm not terribly fond of all the pieces of stdlib Twisted wants you to forego. The alternative option (yes, even after we got all this working), is to focus instead on #46 so we can implement a different IRC engine, and get Python 3 support, and implement async through |
I never looked into I never liked these standard-library pressures of bigger frameworks either, I'll have a look at |
@S0lll0s The one other option we might have as a stop-gap is to implement threading ( |
If each thread can run its own reactor loop (I think it should even?) then the web UI implementation could still be done with Twisted, it'd just have to run the loop internally somehow. |
By the way, do you idle on any IRC networks? It might be nice to have that as a method for discussing some of these changes. I did setup #cardinal on irc.darkscience.net, but am not opposed to adding another server to my IRC client. I also have some questions about |
Sure, shoot me a message on freenode or OFTC (nick like on gh). Probably makes more sense for the small details. |
Oh and I'm doing my testing in |
This is the message I got with the old
Unfortunately |
|
||
# make sure we always end up with a PluginError | ||
if failure.type != PluginError: | ||
raise PluginError(message, plugin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's too bad exception chaining isn't available untili Py3.
I started working on all of this, no doubt the twisted guide was useful. Error handling needs to be improved but the actual unloading part is failsafe now (I think). Ref #58