You can force the function to be executed once using a boolean reference:
def f () = ... end
f_executed = ref false
def f_once () =
if not (!f_executed) then
f ()
f_executed := true
end
end
exec_at(..., f_once)
++
Sam.
On Wed, Mar 20, 2013 at 2:22 PM, Leonard de Ruijter
<[email protected]> wrote:
> On 3/20/2013 13:31, Samuel Mimram wrote:
>> Hi,
> Hello!
>> You can use exec_at. Something like
>>
>> exec_at(freq=60., pred={10h-10h01}, f)
>>
>> will execute the function f every day at 10 am.
> Thanks for this, i assume this is what i want to use. Is there a way to
> cancel the exec_at loop? I need to schedule execution only once.
>
>>
>> Sam.
>>
> Leonard
>> On Wed, Mar 20, 2013 at 12:51 PM, Leonard de Ruijter
>> <[email protected]> wrote:
>>> Hello,
>>>
>>> Now i managed to set metadata of a stream using headers of a http_post
>>> request, i'd like to make a next step. As i mentioned before on this
>>> list, i created a function to start dumping a stream to an mp3-file.
>>> This function can easily be executed with a third party script using the
>>> telnet server, however i'd like to use liquidsoap itself for doing the
>>> job. Is it possible to schedule the execution of a function on a certain
>>> time? for example:
>>> - using a http_post_request, a header dump_start_time is retrieved which
>>> contains the time the function should be executed. I already managed to
>>> export this time header to a single variable.
>>> - The function should be executed on that certain time, also, execution
>>> should occur only once.
>>>
>>> What's the best way to accomplish this?
>>>
>>> Thanks,
>>> Leonard
>>>
>>> ------------------------------------------------------------------------------
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>> _______________________________________________
>>> Savonet-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_mar
>> _______________________________________________
>> Savonet-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users