Apologies, I thought you could achieve the same functionality by setting a
global playlistFile = "foo" at the start of the liq, instead of passing it
via the my_request_function.

 

I refrain from answering your specific question then as there are better
experts. I have tried passing an extra parameter to the request function
before, and wasn't successful.

 

Best


Christo 

 

 

From: Mark Jeghers [mailto:[email protected]] 
Sent: Thursday, April 21, 2016 10:00 AM
To: [email protected]
Subject: Re: [Savonet-users] Passing parameters into request.dynamic
function?

 

That's not the part I am asking about.  I am asking how to pass a dynamic
parameter INTO my_request_function

 

def my_request_function(playlistFile) =  <-- THIS PART HERE

  # Get the first line of my external process

  result = list.hd(get_process_lines("./next_song.sh "^ playlistFile))

  log("Next song "^result)

  # Create and return a request using this result

  request.create(result)

end

 

From: Christo Grozev [mailto:[email protected]] 
Sent: Thursday, April 21, 2016 12:57 AM
To: [email protected]
<mailto:[email protected]> 
Subject: Re: [Savonet-users] Passing parameters into request.dynamic
function?

 

Yes it is possible. I do that for > 100 channels on the same machine and it
works seamlessly. Here is an actual example where I send both the channel
name (as second argument) and the port for telnet manipulation (as a third
argument)

...

    get_process_lines("/usr/bin/php /var/www/html/regiocast/get_next.php --
#{quote(channel)} #{quote(string_of(port))}"))

 

..

 

From: Mark Jeghers [mailto:[email protected]] 
Sent: Thursday, April 21, 2016 9:45 AM
To: [email protected]
<mailto:[email protected]> 
Subject: [Savonet-users] Passing parameters into request.dynamic function?

 

I have a function that calls a shell script and generates the next song to
stream.

 

def my_request_function() =

  # Get the first line of my external process

  result = list.hd(get_process_lines("./next_song.sh"))

  log("Next song "^result)

  # Create and return a request using this result

  request.create(result)

end

 

# Create the sources

plc = request.dynamic(my_request_function)

 

I want to re-use this for multiple streams that have totally different
playlists.  But to do this, I need to be able to pass parameters into the
function.  I need to be able to do something like this.

 

def my_request_function(playlistFile) =

  # Get the first line of my external process

  result = list.hd(get_process_lines("./next_song.sh "^ playlistFile))

  log("Next song "^result)

  # Create and return a request using this result

  request.create(result)

end

 

Is this possible at all?  Or will I have to wastefully duplicate the
function for each different playlist?

 

Thanx,

/Mark

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to