Questions tagged [long-polling]

In web programming, long-polling is an emulation of pushing data, implemented by repeated polling with delayed response.

Long polling is itself not a true push; long polling is a variation of the traditional polling technique, but it allows emulating a push mechanism under circumstances where a real push is not possible, such as sites with security policies that require rejection of incoming HTTP/S Requests.

1099 questions
15
votes
1 answer

How to use long polling in native JavaScript and node.js?

I need to implement long polling for a chat application. I've searched around, but I only find how to implement it in JavaScript using JQuery. How can I implement it using only native JavaScript and node.js? Can you guide me to some relevant…
user8244016
  • 929
  • 3
  • 12
  • 24
15
votes
3 answers

Polling request for updating Backbone Models/Views

I need to find a way to update a web App implemented with backbone. The use case will be the following: I have several Views, and each View, or maybe model/collection related to this view, needs to make different polling request to the server at…
Lorraine Bernard
  • 13,000
  • 23
  • 82
  • 134
14
votes
2 answers

How to use SignalR on Flutter?

I am trying to communicate with an Asp.Net core 2.1 application that uses SignalR to establish its chat communications, but I can't figure out what's the best way to accomplish that using flutter. I've searched for some library to do that, but the…
Diego Garcia
  • 1,134
  • 1
  • 12
  • 25
14
votes
2 answers

AJAX Polling Frequency - To long poll or not to long poll?

I'm building a component of a web page that needs relatively constant database polling. I can see two different approaches for this, and I'm wondering if one of them is better than the others, or if I'm missing a third option. 1) Send off an AJAX…
Derek
  • 1,196
  • 11
  • 32
14
votes
2 answers

Tornado blocking asynchronous requests

Using Tornado, I have a Get request that takes a long time as it makes many requests to another web service and processes the data, could take minutes to fully complete. I don't want this to block the entire web server from responding to other…
ElJeffe
  • 637
  • 1
  • 8
  • 20
13
votes
1 answer

Under what circumstances will my browser attempt to re-use a TCP connection for multiple requests?

I am using Firefox, but I'd like to know how browsers decide this in general. It seems that when I access the same URL twice in a short amount of time, my browser tries to re-use the TCP same connection for both requests (this is called…
Mark
  • 5,286
  • 5
  • 42
  • 73
13
votes
3 answers

Multiple AJAX requests delay each other

I have a long polling request on my page. The script on the server side is set to timeout after 20 seconds. So, when the long polling is "idling", and the user presses another button, the sending of that new request is delayed until the previous…
F.P
  • 17,421
  • 34
  • 123
  • 189
13
votes
1 answer

How does fallback work with socket.io?

I'd like to use WebSocket with Java. Problem is, my server is separated from the client by a proxy that cannot be configured. I've been searching for implementations of WebSocket with fallbacks such as long-polling. I've found socket.io but don't…
Grégoire Borel
  • 1,880
  • 3
  • 33
  • 55
13
votes
12 answers

Long polling PHP returns 2 results instead of one

I'm trying to create a Posting System just like Facebook. So I did a little bit research about how Facebook does it, Facebook uses long polling، So I searched around on how to implement it, I implement it. And I finally finished it, I opened both…
Akar
  • 5,075
  • 2
  • 25
  • 39
13
votes
1 answer

Kafka long polling

I'm looking at kafka to implement a low-latency message queue, and I've been reading up about consumer long polling. However, there are no examples about how to actually use long polling, or what options you need to set to enable it. How do you…
thecoop
  • 45,220
  • 19
  • 132
  • 189
13
votes
2 answers

Implementing long polling in scala and play 2.0 with akka

I'm implementing long polling in Play 2.0 in potentially a distributed environment. The way I understand it is that when Play gets a request, it should suspend pending notification of an update then go to the db to fetch new data and repeat. I…
stevew
  • 674
  • 10
  • 19
12
votes
1 answer

Long-polling vs Apple Push Notification Service & Android C2DM

I am building a mobile application that has some realtime constraints. Therefore I turn to stackoverflow to get advices & opinions and attempt to decide which is the best solution to update the state of the application while running: rely on…
12
votes
5 answers

How to use Servlet 3 @WebServlet & async with Spring MVC 3?

I would like to integrate the servlet 3.0 async support with spring MVC. Something like: @RequestMapping("/chat") @WebServlet(name="myServlet", asyncSupported=true) public String getMessage(String userName) { ...... } is it possible?
Ben
  • 1,657
  • 4
  • 16
  • 21
12
votes
1 answer

Which is better WebSocket or Long Polling in Signalr?

I want to make Asp.NET Web Chat Application and found that Signalr is best option for this. I found one sample Project with Long Polling but it seems that it takes such a long time to send message or it just cancels it. I want to make speedy Chat…
Jeeten Parmar
  • 5,568
  • 15
  • 62
  • 111
12
votes
1 answer

Long Polling with Spring's DeferredResult

The client periodically calls an async method (long polling), passing it a value of a stock symbol, which the server uses to query the database and return the object back to the client. I am using Spring's DeferredResult class, however I'm not…
1 2
3
73 74