Hi,

{ 16h-17h } is already a short notation for a boolean: actually its
type is () -> bool, which means that it is a function taking an empty
list of arguments, returning whether the time constraint is valid each
time it is called!

++

Sam.

On Wed, Mar 20, 2013 at 4:18 PM, Leonard de Ruijter
<[email protected]> wrote:
> TO add another question: i need to parse a time interval in a string as
> being a real boolean time interval. Almost the same as the problem
> described in http://comments.gmane.org/gmane.comp.audio.liquidsoap.user/3620
> Have any changes been made to make this possible? bool_of_string("16h")
> returns false, 16h itself returns true, so the bool_of_string function
> doesn't work in this case
>
> Leonard
> On 3/20/2013 14:57, Leonard de Ruijter wrote:
>> Hey Sam,
>>
>> Does this imply that the exec_at function still keeps looping, even when
>> the f_executed variable is true and the f_once function doesn't do
>> anything itself? or is exec_at canceld whenever f_once returns false?
>>
>> Leonard
>>   >On 3/20/2013 14:41, Samuel Mimram wrote
>>> 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
>>>
>>
>> ------------------------------------------------------------------------------
>> 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

Reply via email to