-
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
Add a web UI to Cardinal #58
Comments
the only problem I have right now is that closing the connection is an asynchronous operation in twisted and so Cardinal needs to wait for that Deferred's callback before attempting to re-instantiate the plugin (see the web-plugin branch on my fork) |
master...S0lll0s:web-plugin#diff-4e0d2d6392603e098942bdded44b0f30R460 -> Is there a reason you moved the unload up? It was after the I'm not quite sure I'm following the issue: Reloading doesn't work, or you can't get it to load up even the first time? Is that also what the referenced change was attempting to alleviate? Theoretically, could we create a thread from the Granted, message passing could be tricky. |
Well, the web plugin ties into the same The web plugin, like some other future plugins might, uses a resource that can only be owned by one plugin at a time: the webserver port. Because the port is locked in the constructor, it needs to be cleaned up before the next version is instantiated. There are other workarounds like deferring the server creation until the port is free again (that would bloat the web plugin slightly) but that's where I stopped today and came here for feedback instead because I think this is a relatively deep-running issue that you might want to resolve with a bigger restructuring (like making Cardinal use |
@S0lll0s I will be honest -- I made a scrub move when I initially implemented TwistedIRC into Cardinal. I'm not terribly familiar with Twisted, or its architecture (I know, right?) In fact, I was planning to try to move away from Twisted in the somewhat near future, towards probably: https://github.com/LK-/lurklib Reasons being:
#47 kind of alludes to this. For that reason, I'm not terribly tied down to the idea of using Twisted for this. It's certainly an option, and if you think it's a good call, I'm down. But I think I'm going to need to start really understanding how Twisted is meant to be used, which means I don't have a great answer for you right this second. :( |
Okay, so I did some brief reading on Disadvantages in my mind are:
I hope I'm understanding correctly. |
I suppose another method might be to shift the responsibility to the plugin -- I'm thinking essentially that the plugin would define a callback to be added as a callback to the |
Exactly my thoughts basically (apart from the second option, I don't think it will work well and it would be rather un-DRY). Timeouts shouldn't be hard to do I think, deferreds can be failed too and the handler would still work, but some changes to Cardinal's core would definetely need to be made to ensure that commands don't completely block each other I think. |
Yeah, the second option seemed pretty nasty. :P I try to consider at least two options before going with one. I am going to try to take a look at her command handling later today or tomorrow and try to determine a good way to implement async across her entirety. I'm also making my way through this introduction to Twisted. |
I don't really know twisted either so I guess I should read that too.... |
It's long. :P I don't know how necessary it is to read the whole thing, but I figure if I've been working on a Twisted-based project for a couple years, I should probably figure out what the actual core library is supposed to do. :P |
What facilities for plugin-to-plugin communication are there currently, except custom event types? How would web-plugins make themselves known to the web plugin? What about load oder (and reload oder!)? |
@S0lll0s That's a fun one! And another thing I've been thinking about recently. Hah! It looks like I closed out #9 where I first documented my thoughts on how plugin inter-op could work two years ago, because #17 encompassed it, but then I ignored it when implementing #17. It should be a pretty simple addition. I think the API would have to be an object registered to the PluginManager in some way by the plugin object. Possibly even a As for load order, I was thinking about that for #79 actually. Some sort of dependencies field will be necessary pretty soon. I need to sleep on it. |
API like in #9 looks like it would work fine, I imagine the load order thing could work if you had two loading stages, first all plugins are instantiated, then they are This would make plugin dev pretty complicated though, a dependency system would solve most issues in the main codebase already. |
This is something I experimented with a long time ago. However, I wasn't quite sure how to do threading. I could implement this now.
The text was updated successfully, but these errors were encountered: