[mashup-dev] JavaScript-like Long running services on the server side

Davanum Srinivas dims at wso2.com
Fri Aug 10 20:09:24 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please see below:

Tyrell Perera wrote:
> 
> 
> Davanum Srinivas wrote:
> Tyrell,
> 
> Looks good to me!. i do see a need for some helpers in the future
> 
> - isRunning(id) : check if the service is running at this moment.
> - id[] getLongRunningServices : (please come up with a better name).
> which returns the id array of currently scheduled
> services
> - get(id) : which returns the service object so that say you can
> modify the payload.
> 
>> +1
> 
> 
> etc..One more interesting thing would be to be able to set a start
> time and an end time.
> 
>> It's not clear to me what you meant. Is this in addition to the time
>> period set when first adding the service? Something like;
> 
>> "Run this service once every 2 hours, but during 1100hrs of 11th Aug
>> 2007 to 2300hrs of 21st Aug 2007."?

Think of it like you are scheduling a recurring meeting in the future with a start date and an optional end date :)

One more thing, when you say 60000, do you mean that many milliseconds from the beginning of the previous task or the
end of the previous task? need to doc it appropriately :)

>> thanks,
>
>> Tyrell
> 
> 
> thanks,
> dims
> 
> Tyrell Perera wrote:
>>>> I just want to give a quick update to the list on this, before
>>>> proceeding with the implementation.
>>>>
>>>> What we are trying to implement is something similar to that found in
>>>> javascript as below;
>>>>
>>>>
>>>>     //Setup a function to be executed periodically and get the id
>>>>     var id = window.setInterval("function()", 60000);
>>>>
>>>>    //When done, use the id to stop periodic execution
>>>>    window.clearInterval(id);
>>>>
>>>>
>>>> This approach, among many candidates, looks promising because, the
>>>> pattern is familiar to our targeted user, who is a javascript developer.
>>>> Hopefully it will involve no learning curve.
>>>>
>>>> The way I see it, we can add this functionality to the existing system
>>>> host object. The object needs to take care of generating and storing the
>>>> IDs as well as spawning/terminating the services. We can also use a
>>>> 'Service' host, which stores meta-data required for the service
>>>> invocation.
>>>>
>>>> For instance;
>>>>
>>>>    //Instantiate a service host object
>>>>    var serviceObject = new Service();
>>>>    serviceObject.setEPR = "http://some.epr";
>>>>    serviceObject.setAction = "service-action";
>>>>    serviceObject,setPayLoad = "payload";
>>>>
>>>>    //Initiate a long running service
>>>>    var id = system.setInterval(serviceObject, 60000);
>>>>
>>>>    //Terminate periodic execution
>>>>    system.clearinterval(id);
>>>>
>>>>
>>>> That's the rough plan I have. Please share your thoughts and
>>>> suggestions.
>>>>
>>>>
>>>> Tyrell
>>>>
>>>>
> 
> 
>>

- --
Davanum Srinivas (dims at wso2.com)
Co-Founder & Director, Customer Engagements, WSO2 (http://wso2.com)
Yahoo IM: dims Cell/Mobile: +1 (508) 415 7509
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFGvShkgNg6eWEDv1kRApA+AJ0c5798WAWf+ipWUgSx4dMfE31SKgCeKn8T
HgImI8nIaokKnJphE29jBPY=
=wCk3
-----END PGP SIGNATURE-----




More information about the Mashup-dev mailing list