Skip to content
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

Release of new refactored version of IRC-Bot? #7

Open
oliveratgithub opened this issue Dec 29, 2014 · 6 comments
Open

Release of new refactored version of IRC-Bot? #7

oliveratgithub opened this issue Dec 29, 2014 · 6 comments

Comments

@oliveratgithub
Copy link

Hi @ElvenSpellmaker
You mentioned in the issue #6 , that you are currently working on refactoring the IRC-Bot and going to release an updated version soon.

Can you give any estimated date when you will have it ready? I just did an implementation of the original super3/IRC-Bot@9d14188 and I am getting at its limits by extending it with some features I need. And honestly I felt dumb realising I worked on a year old code base and then saw your comment that you are working on an active refactoring ;)

Would be great to know when it's ready, so I can estimate if I should spend any more time on my current implementation, or wait to replace it completely with your new one (it looked pretty good from what I saw in the current repo, so I'd like to switch).

Thanks,
Oliver

@ElvenSpellmaker
Copy link
Owner

Hi @oliveratgithub,

I am actively working on my refactor, the front-end process is nearly done and the back-end process will be started soon.

I have been distracted the past couple of days through preparing my MonkeyLoader (https://github.com/ElvenSpellmaker/MonkeyLoader) library which the back-end will use to be able to re-load plug-ins.

I see that the original project has suddenly got a new lease of life (just as I start doing mine too) which is weird, but nice to see. I'll definitely be keeping an eye on it to make sure I don't miss out putting anything decent into my new version.

If you can think of anything that's needed or wanted then let me know and I'll try to work something out.

I am tempted to hack the back-end to work with the new front-end and release it as an intermediary release.

@oliveratgithub
Copy link
Author

That's great news @ElvenSpellmaker . If you want to have somebody testing a preview of the new release, I'd be happy to do so!

2 things that I am currently in need with the IRC-Bot and want to give you on the way for the refactored version:

  • Database integration (see Database Implementation super3/IRC-Bot#23 , I found a way to do this for my implementation of the bot already)
  • Isolated "loops" from the main code. I.e. have the bot watch a database-table or files regularly for changes and, if there are any, push them to the IRC channel.

Again, if you need somebody to test the new release, I'd be glad to do so.

@ElvenSpellmaker
Copy link
Owner

By database integration do you mean a standard and central way to connect to a Database for use in plug-ins etc?

Threading is a massive problem in PHP as it doesn't support threads (except pthreads by an extension) which is why my bot uses two PHP processes and not threads...
I am trying my best to allow extra processes to connect via sockets to the back-end much like the front-end does which would allow you to have, but that has many limitations that would need to be solved...

@oliveratgithub
Copy link
Author

By database integration do you mean a standard and central way to connect to a Database for use in plug-ins etc?

Exactly.

Threading is a massive problem in PHP as it doesn't support threads

Yes, I know it goes towards multithreading which PHP doesn't support oob. (and honestly, also might be a bit oversized for the PHP Bot). I am still thinking of another creative way of getting this done... Probably just include a watcher that closes if nothing new has been found in the database, and looping thorugh with an open db-connection (instead of initialising a new connection every time the function runs through).

@ElvenSpellmaker
Copy link
Owner

Hmm I am wondering if using the pthreads extension would be considered wise. It's gaining traction and it's not too difficult to re-compile PHP with ZTS support, and it even works on Windows with a pthreads dll download.

It would remove the need for the multiple process model, which while it works is starting to cause some problems (the need for a NICK sync, problems with message histories and nicks in channel, etc., etc., etc.).

I'd have the main bot in the main thread, the commands etc. would be in one thread, and then the option for people to create their own threads for use in such plug-ins as !remind which would need to keep track of time and do things at the correct time.

@ElvenSpellmaker
Copy link
Owner

To update you on the status of the re-write, I have just about finished the re-write of the front-end bot, which I am currently testing on freenode, and it seems to be working OK, but it's noticeably slower, which is why my thoughts about the above seem better than continuing this multi-process model.

Re-writing code in a nicer and more OO way certainly slows the code down! (But also the code for handling multiple servers also slows it down)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants