-
Notifications
You must be signed in to change notification settings - Fork 98
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 list representations, unicode support and multiple threading usage #97
Conversation
Improve list representation, unicode support and multiple threading usage
@g-gemignani Thanks a lot for your contribution! Could you add your name to CONTRIBUTORS? Are there any plans to migrate to Python 3 on your side soon? I will add a section to the README to list companies that use PySwip. Hopefully that will increase the awareness to PySwip. Would it be a problem if I list Magazino GmbH under that section? |
Hi @yuce, thank you for the quick reply. I just added my name to the contributors. At Magazino we are slowly transitioning to python 3 and I believe we should complete the transition in the next few months. About adding Magazino to the list of companies using PySwip, I asked the company and there are no issues from our side. Thank you! :) |
That's great, thanks! |
@g-gemignani the multi-threading improvement looks great! |
Hi @vakker, thanks for the comment. I need to check what I can share but I can tell you the idea behind the snippet and how we use it. |
@g-gemignani thanks for the info, that sounds cool! from multiprocessing import Pool
from pyswip import Prolog
prolog = Prolog()
def exec_query(q):
return prolog.query(q)
with Pool(3) as p:
print(p.map(exec_query, ['query_1', 'query_2', 'query_3'])) This uses |
As far as I remember, the server is not able to process queries in parallel, the snippet of code is there just to allow to be called by different threads but it should still be in sequence. We have implemented a master slave node that processes queries in order. Try it out and see :) |
Hello,
we have been using this library at Magazino GmbH for quite a while now and made some improvements on top of it.
We would like to contribute back, hence this PR.
Changes: