ruote tmp/log_2011-01-18.html

2011-01-18 10:59:38 utc gonzalo_ hi, I have a question on how to register a participant
2011-01-18 11:00:13 utc tosch_le hi gonzalo!
2011-01-18 11:00:20 utc gonzalo_ i would like to register it with some params. one of the params is an object (xmppconnection) for example
2011-01-18 11:00:20 utc tosch_le i'll try to answer it, then.
2011-01-18 11:00:32 utc gonzalo_ hi tosch_le
2011-01-18 11:01:00 utc gonzalo_ the thing is that those params i get in the initialize method are turned into strings
2011-01-18 11:01:38 utc gonzalo_ is this possible?
2011-01-18 11:02:16 utc tosch_le shall they be turned into strings or shall they not?
2011-01-18 11:02:47 utc gonzalo_ I would need the actual objects so I can call its methods inside the participant
2011-01-18 11:02:57 utc gonzalo_ they shall not
2011-01-18 11:04:05 utc tosch_le ok. this'll have something to do with the distributed architecture of ruote, the participant registration info is shared amongst the workers and thus put in the storage
2011-01-18 11:04:51 utc tosch_le with the options serialized to json
2011-01-18 11:05:21 utc tosch_le at de-serialization time in the worker, the objects can't be reconstructed
2011-01-18 11:05:31 utc gonzalo_ ummm... ok
2011-01-18 11:05:38 utc gonzalo_ yes makes sense
2011-01-18 11:06:07 utc tosch_le so, your options have to be json-serializable
2011-01-18 11:06:31 utc gonzalo_ yes i guess :) thank you for the info
2011-01-18 11:06:42 utc tosch_le use ids or something like that to re-construct the objects in the initializer of your participant, i'd say
2011-01-18 11:06:55 utc tosch_le never mind, your welcome!
2011-01-18 11:07:17 utc tosch_le s/your/you're/
2011-01-18 11:08:21 utc gonzalo_ i was thinking in having that xmmpconnection object as a global object within RuoteKit module namespace
2011-01-18 11:08:33 utc gonzalo_ don't know if this is a good decision...
2011-01-18 11:08:57 utc tosch_le if it's working for you, it is ;-)
2011-01-18 11:09:29 utc tosch_le but take care, ruote itself doesn't know about the RuoteKit module
2011-01-18 11:10:20 utc gonzalo_ yes I know... I'll try it an see how it works...
2011-01-18 11:10:28 utc tosch_le in fact, you could use an own module for that.
2011-01-18 11:10:29 utc gonzalo_ many thanks for the info and tips
2011-01-18 11:10:30 utc gonzalo_ :P
2011-01-18 11:10:42 utc tosch_le MyApp.xmmpconn = Xmmp.new
2011-01-18 11:10:55 utc tosch_le in your participant
2011-01-18 11:11:07 utc tosch_le MyApp::Participant
2011-01-18 11:11:09 utc gonzalo_ yes maybe thats a better design
2011-01-18 11:11:29 utc tosch_le def reply
2011-01-18 11:11:40 utc tosch_le MyApp.xmmpconn.do_this_and_that
2011-01-18 11:11:43 utc tosch_le end
2011-01-18 11:11:53 utc tosch_le it's definitely cleaner
2011-01-18 11:12:20 utc tosch_le and you won't run into problems if we decide to add a xmmpconnection method or object to the RuoteKit module
2011-01-18 11:12:35 utc tosch_le not that i suppose that'll happen ;-)
2011-01-18 11:12:58 utc gonzalo_ :P
2011-01-18 11:13:09 utc tosch_le have to leave now, lunch time :-)
2011-01-18 11:13:25 utc gonzalo_ ok thanks tosch_le
2011-01-18 11:13:28 utc tosch_le i'll be around again later