3

We have developed a C# Webservice in Service stack. In this whenever we get a request for checking the availability of a Data we need to check in the Database and return the result. If data is not there we need to wait till we get data and return the value. If no data upto certain time period then need to Timeout it.

We are using SQL Server for our application.

Can anybody tell us how to implement Long polling in service stack. Our request has to wait in the server side and return the output.

Regards Priya

Priya
  • 31
  • 1
  • Hi Priya, I have been using ServiceStack from a while, I suppose Service Stack doesn't give any option for Long Pooling. I have done Long Polling with WCF, but not with service stack. Probably you need to put some logics to work it around, like Async Timers. – Nipun Ambastha May 03 '13 at 09:40
  • Hi Nipun,Thanks for your response. Yes as you said with WCF we can do Long Polling. But my requirement is to use SERVICE STACK. Do you have any idea on this or any reference link for this. I am trying to get the Contact information for SERVICE STACK support call. but unable to get any info about the number. – Priya May 03 '13 at 13:55

1 Answers1

2

There is a discussion on the ServiceStack Google Group regarding ways to implement long polling in Service Stack.

Basically, you implement a service that just loops and wait for server-side data to become available, and only returns either after a timeout (say 30s) or when data is available.

The client on the other hand continuously loops requests to the service and waits for it to return or timeout as well.

Renaud Bompuis
  • 16,596
  • 4
  • 56
  • 86