Closed WyriHaximus closed 8 years ago
Can't those things be added before the event loop, though? That's part of why the bot is structured as it is: plugins have a chance to use the event loop before the bot tells the client to run it. I'm trying to consider this change in terms of how it would work with the bot in scenarios like these.
Where this fits in for me is running more then a Phergie bot in a single event loop. In this specific case it will also run a websocket server that interacts with an UI and a phunin-node to monitor it all.
Where it doesn't necessarily make sense to do this, it does for the client. (The bot is build as a standalone app.) But the client could be used for more then a bot as it could be integrated into a bigger app like my use case. Of course I could set up everything before Phergie runs the bot but that will cause troubles when I want to integrate another package that does exactly the same. Plus it gives control over the loop out of hand.
I've set this up in such a way it doesn't alter the default client behavior.
Fair enough. This implementation makes sense to maintain BC. In the next major version, I'd probably suggest making this the default behavior and requiring the end-user to kick off the loop outside the Client
class.
Cheers, and very much appreciated. I've also added a note on this to the read me.
Anything blocking this from being merged? (And preferable tagged.)
Not that I know of. Was leaving it to @svpernova09 or @rocketpastsix to merge.
Ping @svpernova09 or @rocketpastsix :)
Currently the run method will auto start the loop, this isn't ideal when running more then phergie within the event loop