Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Long polling in SERVICE STACK

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

like image 951
Priya Avatar asked May 24 '26 10:05

Priya


1 Answers

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.

like image 170
Renaud Bompuis Avatar answered May 27 '26 01:05

Renaud Bompuis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!