[08:10] *** Uraeus has joined #kamaelia
[08:10] *** Patrick` has joined #kamaelia
[08:10] *** Lawouach has joined #kamaelia
[08:10] *** eikenberry has joined #kamaelia
[08:10] *** tdobson has joined #kamaelia
[08:11] *** aa_ has joined #kamaelia
[08:11] *** vmlemon has joined #kamaelia
[09:19] *** mhrd has joined #kamaelia
[09:29] *** MS- has joined #kamaelia
[15:35] *** MS- has parted #kamaelia
[17:16] *** taj has joined #kamaelia
[17:16] < taj> hi folks
[17:16] < taj> I'm trying to integrate axon's scheduler into my PyQt app
[17:16] < taj> so that it runs within the Qt event loop
[17:17] < taj> I've written a small replacement scheduler subclass and was hoping someone could point out if I had done anything exceptionally stupid
[17:17] < taj> http://sirtaj.net/projects/axonqt.py
[20:12] < Lawouach> taj:
[20:12] < Lawouach> I have something you might like
[20:13] < Lawouach> taj: http://trac.defuze.org/wiki/jlib
[20:13] < taj> Lawouach: does it have cheese in it?
[20:13] < taj> looking...
[20:13] < Lawouach> http://trac.defuze.org/browser/oss/jlib/jlib/core/qaxon.py
[20:13] < Lawouach> no cheese
[20:13] < Lawouach> I'm French but I hate cheese with a passion
[20:14] < Lawouach> that qaxon module is all you need to interface Kamaelia/Axon with PyQt4
[20:14] < taj> nice!
[20:15] < Lawouach> it's geared towards my requirements but can be easily adapted
[20:15] < taj> heh it took me a moment to work that out :) but I got there
[20:15] < taj> thanks man that's great
[20:15] < taj> I noticed that Kamaelia hasnt had a release in a while. is it still being actively developed?
[20:15] < Lawouach> oh yeah
[20:16] < Lawouach> it's one of those projects which is carried mostly by one or two developers
[20:16] < Lawouach> so it looks like it's dead but it isn't
[20:16] < taj> yes I figured
[20:16] < Lawouach> So yeah it is very much alive
[20:16] < Lawouach> :)
[20:16] < taj> is it still under the bbc umbrella, or is it now a side-project of the devs?
[20:17] < taj> not that it matters but just curious
[20:17] < Lawouach> hmm
[20:17] < Lawouach> Michael would be the best to answer that question but AFAIK, it's not carried by the BBC any longer. Michael happens to work for the BBC but he works on Kamaelia on his spare time.
[20:18] < Lawouach> I don't think the BBC is actively supporting the project anymore.
[20:18] < Lawouach> Doesn't mean the project failed in any way
[20:18] < Lawouach> It's just probably not in scope any longer.
[20:19] < Lawouach> OH BTW, jlib is under GPL if I remember well because PyQT4 is using that license. I usually prefer BSD myself.
[20:19] < Lawouach> BUt couldn't use it in this case.
[20:20] < taj> thanks for the heads up
[20:20] < taj> you can actually release jlib under BSD anyway, but that's another discussion :)
[20:20] < Lawouach> well it isn't clear
[20:21] < Lawouach> the guys behind PyQT seem to argue I can't
[20:21] < taj> as an old-school KDE developer I've had to learn some of this stuff the hard way :-)
[20:21] < Lawouach> yeah but the Python "import" is like linking to PyQt
[20:22] < taj> it is
[20:22] < taj> so the combined project is definitely bound by the GPL
[20:22] < taj> but you can use any licence you like for your own code
[20:22] < taj> anyway like I said - this is somewhat offtopic
[20:22] < Lawouach> I see
[20:23] < Lawouach> thanks for the heads up
[20:29] < taj> ok I think I understand what you did there
[20:30] < taj> you are running the axon scheduler in another thread
[20:30] < taj> that is a good general solution, but my goal is slightly different - I want to keep it single-threaded and use the Qt event loop as the scheduling "point"
[20:31] < taj> this allows me to make regular Qt calls from within the microprocesses without having to worry about Qt threading issues
[20:32] < taj> of course that won't work with threaded components but for regular, generator-driven components it works
[20:35] < Lawouach> the example runs the scheduler in a different thread indeed
[20:36] < Lawouach> that was convenient here
[20:36] < Lawouach> however I don't use threaded component either
[20:37] < Lawouach> I actually never use them
[20:37] < Lawouach> I don't see much point in their existence except in some very specific cases
[20:38] < Lawouach> That's why I'm a bit confused as what you have in mind here
[20:38] < Lawouach> the only way would probably be to hook into the Qt mainloop
[20:38] < Lawouach> I remembered wishing doing just that but that wasn't as easy as it sounds
[20:39] < Lawouach> because Qt doesn't expose it internal loop like Gtk would probably do
[20:40] < taj> have a look at the url I pasted above - I have implemented it but I am not certain it is correct
[20:40] < taj> Qt does in fact expose its event loop
[20:40] < taj> but I'm just using a QTimer with zero timeout
[20:40] < taj> http://sirtaj.net/projects/axonqt.py
[20:41] < Lawouach> I see
[20:41] < Lawouach> I don't find the timer bit very elegant myself but that doesn't mean it's wrong
[20:42] < Lawouach> matter of taste really :)
[20:42] < Lawouach> Regarding the mainloop, how does Qtexpose it?
[20:42] < Lawouach> I'm curious :)
[20:43] < Lawouach> note also that I've long thought we ought to eventually make the scheduler mainloop more "pluggable"
[20:43] < taj> http://doc.trolltech.com/4.5/qeventloop.html
[20:43] < taj> but honestly, as ideologically ugly as the qtimer is (I agree with you!), it is the correct way to do this.
[20:44] < taj> all the timer does is immediately queue a timerevent
[20:44] < taj> so the mainloop continues to process events without caring about axon
[20:45] < Lawouach> basically you kind of hi-jack the QTimer object to glue the scheduler
[20:45] < Lawouach> That's probably the most straightforward path
[20:45] < taj> yup
[20:46] < taj> there is the question of granularity - ie how many axon scheduling events should take place between timerevents
[20:46] < Lawouach> I think the way Qt exposes its mainloop doesn't help either for foreign code to be plugged in
[20:46] < taj> but honestly thats a small detail
[20:46] < taj> how is that?
[20:46] < taj> meaning, how could it be improved?
[20:47] < Lawouach> oh it's more a documentation issue here
[20:47] < Lawouach> To me it's rather unclear as to how use it
[20:47] < taj> ah
[20:47] < Lawouach> anywau
[20:47] < Lawouach> regarding the granularity question, I'll be honest I wouldn't know
[20:47] < Lawouach> probably needs some tweaking till you get the throughput you expect
[20:47] < taj> yes I'm not worrying about that
[20:48] < taj> the timerevent overhead is not soo bad that I'm going to worry about it for now
[20:48] < Lawouach> yeah
[20:49] < Lawouach> besides, I'm using similar techniques to wake components up at regular intervals (sometimes you need just that) so I can't spit on that solution either :)
[20:49] < Lawouach> smart choice :)
[20:49] < taj> ;)
[20:50] < Lawouach> :)
[20:50] < Lawouach> anyway, going to bed for now
[20:50] < Lawouach> take care :)
[20:50] < taj> thanks Lawouach