Priya
Priya

Reputation: 31

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

Upvotes: 3

Views: 990

Answers (1)

Renaud Bompuis
Renaud Bompuis

Reputation: 16796

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.

Upvotes: 2

Related Questions