Jorgen Cederlof wrote:
On Wed, Mar 02, 2005 at 23:41:51 -0500, Dave Brondsema wrote:
I'm working on an application which runs wotsap a lot. Currently I am only using the functionality provided by Wot.creategraph. I think it would perform better if I had a python "server" that held an instance of Wot in memory so it wouldn't have to bunzip2, load, and parse the .wot file each time. The server would probably just listen on a socket for query requests, and the loadfile method would be called each night.
Yes, that would be nice. It shouldn't be too hard to implement, depending on what you want to do. Webware-Main.py, which handles requests from http://www.lysator.liu.se/~jc/wotsap/search.html , does something similar. It checks if the .wot file in the file system has been updated and reloads it when needed. You might want to start from there and edit it to suit your needs. But most of the server functionality is handled by Webware so you'll have to write that anyway.
If you make something pretty and general and send it to me I will of course include it. It would be nice to just start a server with "wotsap --server" and then be able to run wotsap as usual, with the only difference that it is faster. It will need to be secure, but using a unix domain socket with good permissions should be pretty safe.
On the other hand, if you just need some quick hack for a specific task, just create a server listening to a Unix domain socket for questions in a simple protocol. cPickle might be useful if the questions are a little bit complicated and you have Python programs at both ends.
Thanks for the tips; I'll work on that.
It would also be very nice to have this server's data be updated in realtime from a keyserver instead of loading a new .wot file each night. I have no idea how to do this though.
Yeah, it would be nice, but it would require quite some work. Right now, creation of a .wot file takes a couple of hours when running directly on a key server. If we could update in realtime we would also be able to create a .wot in realtime. That would require lots of optimizations and probably hacking the key server software to notify about interesting changes, but it should not be impossible.
Hooking into the key server for notifications sounds like the best way to do it, but like you said probably quite a bit of work. At this point I think I'll just do the above option. Perhaps we'll reconsider this one in the future.
Thanks, wotsap is working great for us already.
Good to hear. May I ask what you are using it for?
We're working on a college senior project; it involves specifying topical trust values between individuals and we are using PGP keys to verify identity before we can compute a trust value along a path. We'll let you know when we have something presentable.
-- Dave Brondsema : dave@brondsema.net http://www.splike.com : programming http://csx.calvin.edu : student org http://www.brondsema.net : personal