[06:11] *** vmlemon_ has joined #kamaelia |
[07:22] *** vmlemon_ has joined #kamaelia |
[08:51] *** Davbo has joined #kamaelia |
[08:53] *** MS- has joined #kamaelia |
[08:53] < MS-> morning |
[08:54] < Davbo> Morning MS- |
[08:56] *** vmlemon_ has joined #kamaelia |
[09:23] *** Uraeus has joined #kamaelia |
[10:01] *** vmlemon_ has joined #kamaelia |
[10:03] < vmlemon_> Hi |
[10:06] < MS-> hi |
[10:55] *** ian_brasil has joined #kamaelia |
[11:48] *** vmlemon_ has joined #kamaelia |
[12:01] *** Lawouach_ has joined #kamaelia |
[12:14] *** ben017f has joined #kamaelia |
[12:14] < ben017f> anyone about? |
[12:14] < MS-> yep |
[12:38] < ben017f> hi :-) |
[12:38] < ben017f> i've just started building a simple queue service and ec2 based app and I'm using Kamaelia, can I ask a couple of questions about polling? |
[12:51] < MS-> Sure, I'm personally a little vague at this moment, so you may get a delayed reaction. |
[12:54] < ben017f> ok, no worries, i have six month old to look after - isn't concurrency great?! |
[12:55] < ben017f> I need a way to not poll the SQS queue every time through the loop, i'd like to set a limit of polling for new messages every 5 or 10 seconds. |
[12:56] < ben017f> I'm guessing the answer lies in the Ipc module, but google hasn't really helped me find someone who's done it before... |
[12:59] < MS-> if rather than using a Axon.Component.component, you use an Axon.ThreadedComponent.threadedcomponent , then... |
[12:59] < MS-> a) remove the yields from the main() |
[12:59] < MS-> b) you can just put a time.sleep(5) in |
[13:00] < MS-> FWIW, Lawouach has written something very similar to SQS in the past, so may be able to help but simply not here |
[13:00] < MS-> If that time.sleep(5) seems to simplistic, it's kind of the point of threadedcomponent - to make it trivial to use blocking code |
[13:01] < MS-> Alternatively you can make something that will send out a message every 5 seconds, and then have your polling code wait to recieve a message telling it to poll |
[13:01] < MS-> That's actually probably the better / more general approach, but makes using your component potentially slightly harder |
[13:02] < ben017f> so you don't the yeild statements in main then..? |
[13:02] < ben017f> could you repeat the 2nd to last message? i didn't get it all.. |
[13:03] < MS-> sorry, I'll pastebin it |
[13:04] < ben017f> it's ok, i got it now, something up with my KDE and X drivers, the screen didn't update! |
[13:05] < MS-> http://pastebin.com/m48fca5fc |
[13:06] < ben017f> the thing that will send a message every 5 secs sounds good, that would be a component too i assume? if i gave my SQSReciever class a child that sent a control message every x seconds would that work, or does pausing a component pause its children too? |
[13:07] < MS-> self.pause() |
[13:07] < MS-> yield 1 |
[13:07] < MS-> Will make just the current component pause |
[13:08] < MS-> It pauses until a message is either taken from an outbox or delivered to an inbox |
[13:08] < ben017f> ok, so a child component that send a message to the parent's inbox to tell it to poll every x seconds and a self.pause() in the parent's main method should work then..? |
[13:09] < MS-> yep |
[13:09] < MS-> just creating a pastebin example :) |
[13:10] < ben017f> brilliant, thanks very much! I saw your pyconuk talk by the way, very nice :-) |
[13:10] < ben017f> s/talk/talks/ |
[13:11] < Lawouach_> a fan :) |
[13:11] < Lawouach_> at last! |
[13:12] < MS-> ben017f: Untested: http://pastebin.com/m3f00a8dc |
[13:12] < ben017f> how about the WaitComplete class is that an option? |
[13:12] < MS-> ben017f: Very much appreciated |
[13:12] < ben017f> cheers |
[13:12] < MS-> ben017f: Yes, waitcomplete is a good option too |
[13:12] < ben017f> thanks very much for your help :-) |
[13:12] < MS-> you're welcome :) |
[13:13] < MS-> Oh, didn't join those two things together did I ? :) |
[13:13] < MS-> http://pastebin.com/m38121714 |
[13:14] < ben017f> what's the rationale in using PipeLine instead of self.link from the Poller? |
[13:20] < MS-> ben017f: First thing I thought of really. |
[13:20] < MS-> self.link is equally OK/valid |
[13:20] < MS-> One thing which you do get by allowing the external thing to do the linkages though is that it can simplify testing |
[13:22] < ben017f> ah ok, thanks, sorry for the delay, had some fairly persistent messages hitting my inbox from the little one!! |
[13:22] < MS-> For example you can do this: http://pastebin.com/mb5c6dec |
[13:22] < MS-> ie the backplane stuff is equivalent to the Pipeline |
[13:22] < MS-> But... |
[13:24] < MS-> That latter version also allows this: http://pastebin.com/m313fd51b |
[13:24] < MS-> meaning you could force manual polling is as well |
[13:25] < ben017f> wow, that's a good way to get my head spinning... this kind of thing really requires a paradigm shift doesn't it?! |
[13:28] < MS-> You might say that. If I said that it'd sound like hype :) |
[13:31] < ben017f> he he, well this should all help me learn erlang :-) |
[13:36] < MS-> indeed - personally I don't feel a need to learn erlang :) |
[13:37] < MS-> But then parts of kamaelia's concepts are based on occam (among other things) - which did low level concurrency in this kind of way a long time back |
[13:38] < ben017f> well i am a fan, i've been aware of kamaelia for a while and I'm thrilled to finally have something to use it for! |
[13:38] < MS-> :-) |
[13:38] < MS-> cool |
[13:39] < MS-> please let us know how you get on - many component actually end up being generally applicable & useful, and if it turns out your code is like that it'd be great to merge whatever you feel able to contribute back |
[13:39] < MS-> If you don't, you don't :) |
[13:39] < MS-> Still very interested either way :) |
[13:46] < ben017f> ok, will do... thanks very much for a great library! |
[15:17] *** vmlemon_ has joined #kamaelia |
[15:40] *** Davbo has joined #kamaelia |
[16:24] *** vmlemon_ has joined #kamaelia |
[16:46] *** vmlemon_ has joined #kamaelia |
[16:50] *** vmlemon has joined #kamaelia |
[17:39] *** Lawouach_ has joined #kamaelia |
[17:39] *** GabeW has joined #kamaelia |
[17:39] *** Lawouach has joined #kamaelia |
[17:42] *** vmlemon_ has joined #kamaelia |
[17:59] *** ian_brasil has joined #kamaelia |
[18:00] *** Davbo has joined #kamaelia |
[18:07] *** vmlemon_ has joined #kamaelia |
[18:08] < Davbo> Evenin' all |