Le 09/11/2011 15:55, David Baelde a écrit : > On Wed, Nov 9, 2011 at 11:32 AM, Martin Hamant<[email protected]> wrote: >> Also - I have not tried but - as map_metadata() return a new source, I would >> have to call it *before* I create the output ? >> (But I can't, because I need the output in my update_meta() :D) >> With insert_metadata, it is smooth because I can attach the insertion hook >> to the source before output creation. > Yes, this is annoying. For now you have to use a trick such as the one > I described recently: > > http://www.mail-archive.com/[email protected]/msg05626.html > > In a not so distant future, we will allow recursion. It will be > better, but still not super simple. This kind of problem could be an > argument in favor of a get_source_by_id() function, but I'm not sure > it'd be that great, and the ID/server system might undergo some > changes soon, so we'll have to think this as part of a bigger picture. > > Anyway, go with the dummy function for now. Thanks David for the tip.
For now I am using insert_metadata as it is not so restrictive for the usage I need. I would have further questions but I'll ask it later :) the code resides in http://snipt.org/Umll3 This is the piece of code I wrote that contains metadata update function for dynamic source. It works well as it is when adding source/link, but there is still something to solve when destroying. ( which is done by list.iter(source.shutdown, matching_sources) later in the code ) The poll should also stop in time but - as the output source still exists after source.shutdown - I don't know what to do. Even if I get output to be completely destroyed, remains that the add_timeout() is not interruptible. I feel like I am not doing all of this the "good" way (but I understand I am a precursor in using LS that way :P ) I also have to implement something to remove the data from sources_metadata_paths[] when destroying but that should not be that hard. ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Savonet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-users
