Gustav Brock
Gustav at cactus.dk
Tue Dec 9 07:26:41 CST 2008
Hi Shamil No I don't think you are missing anything! Perhaps my mind is just missing to see the idea of this? What could such a Cron ASP.NET do to call a web service that you can't do with a tiny console app with a timer? Is this just for fun or the thinking, or are you looking for a clever way to meet a special challenge? /gustav >>> shamil at smsconsulting.spb.ru 09-12-2008 12:55 >>> Hi Gustav, But my variation of the "hack" is to have Cron ASP.NET/ASP.NET web service application, which only duty will be to *ping/wake-up* another ASP.NET web service to perform recurrent/scheduled tasks: for this architecture/scenario I do not see currently any problems except that recurrent/schedule tasks shouldn't be very lengthy - and I do not plan to have them running longer than several seconds/half-minute/minute - that should be OK with ASP.NET/ASP.NET web service apps as they are multi-threaded and my recurrent/scheduled threads will be written assuming they are running in such environment... Am I missing something? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, December 09, 2008 1:13 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Is it possible to develop active ASP.NET Web Services? Hi Shamil Well, I would run some kind of service, native of Windows or otherwise external in relation to the site. Like many other commenters calling the idea a "hack", I can't see anything but potential troubles by letting the site itself simulate a Cron job. /gustav >>> shamil at smsconsulting.spb.ru 08-12-2008 22:55 >>> Thank you for your responses Gustav, Drew and William. Here is what I have just found: Easy Background Tasks in ASP.NET http://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ IOW, the subject task was questioned several months before on StackOverflow, and a follow-up discussion (on the same referred above page) highlighted all pluses and minuses of proposed simple solution: I'd try to make it like that now: - use proposed above simple solution on "cron" ASP.Net web site/service, which will query URL on another main ASP.NET web site/service to perform recurrent tasks... It should work, shouldn't it? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of William Hindman Sent: Monday, December 08, 2008 9:38 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Is it possible to develop active ASP.NET Web Services? ...I don't think you can do this as a pure web service ...but you can invoke a "with events" protocol from an outside timer/event based call to invoke asynchronous Web Service method calls to implement callback events from a Web Service to its clients ...hope that makes sense. William -------------------------------------------------- From: "Shamil Salakhetdinov" <shamil at smsconsulting.spb.ru> Sent: Saturday, December 06, 2008 1:22 PM To: "'Access-D - VB'" <dba-vb at databaseadvisors.com> Subject: [dba-VB] Is it possible to develop active ASP.NET Web Services? > Hi All, > > ASP.NET Web Services are known to be passive IOW they are activated when > called from outside, they do some work, and quit until another web request > comes... > > ...I wonder is it possible to develop active web service, which will be > activating itself once in a while (e.g. by using a kind of schedule > controlled by timer + some programmatic logic)... > > ...that active service could be something like endlessly > running/sleeping/running... between resets web service method IOW a web > service method with timeout set to infinitum... > > ...because ASP.NET web services application is by definition multi-threaded > having one thread like the questioned/requested above shouldn't be an issue > for the other IMO... > > ...this thread could be started by outside call or even (I guess) by web > service itself calling its own method with infinitum timeout on start-up > *via loopback web service call not directly* or something like that... > > ...that questioned/requested solution should be pure ASP.NET web service one > as it's planned to be used on ASP.Net hosting without access to the host > operating system to run scheduled Windows Service etc... > > ...it could happen that questioned/requested Web Service solution is > built-in ASP.NET feature: I must say I didn't investigate the docs/I didn't > try to make a POC solution - I expect somebody here might have done > something like that already - all I need is an answer: yes, it can be done, > RTFM => {{URL}}} ... > > Thank you. > > -- > Shamil > > P.S. Sorry, I didn't do in advance investigation - I just didn't want to get > negative answer by myself - and if positive answer exists I'd be glad to > share it with you, and you'll be ready for such a "tricky"/unusual (?) > solution using Web Services in advance...