Hey,

On Mon, Aug 23, 2010 at 8:38 AM, rafael <[email protected]> wrote:
>    Thanks a lot for helping me learn more about liquidsoap. It is also
> being a practical school for me to learn more about functional languages
> (should not have missed those classes :) ).

I'm glad I can spread it.

> add_protocol(temporary=true,"myplaylist",  fun (_,_) ->
> [get_process_output("python list.py")])
>
> in an imperative language would be analogue to:
>
> myplaylist = get_process_output("python list.py")

Good point, your version, followed by playlist(myplaylist), is
equivalent and simpler. It's still functional, by the way.

> Is this what add_protocol function exists for? Setting variable values?

The point of adding a protocol is to create a new file creation
method. It was pointless in my example unless there is some reloading
of the playlist. With a protocol the reloading triggers a new call to
the python script. With your version the reloading would use the
output of the first and single call of the script.

Back to the practical goal now:

>    Also, one of the behaviours I expect (and this is why I used
> request.dynamic in the first place) is to permit someone to change a
> playlist (let's say a jingle folder), just by moving files from and to
> that folder (through ftp, for example).

For that purpose playlist(reload=3600,"/path/to/folder") is good
enough. It takes all files from the folder, and refreshes that list of
files every hour (3600 seconds). If you don't like the ad-hoc delay,
you could also setup a notification-based script that watches for
modifications on the directory and triggers the reloading via a telnet
command.

Cheers,
-- 
David

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to