polling

Polling, Comet, WebSockets, etc

混江龙づ霸主 提交于 2019-12-03 09:47:24
问题 I'm needing to build in some pretty agressive "auto refresh" capabilities into a web application. It's kind of a photo gallery and the images are stored on AmazonS3 but the data about the images are stored in our own database. I've played around with polling the server and sending ajax calls to get the updated data. I'm really concerned about the load on the server(s) with this method. At times, the page would need to be updated every 15 to 30 seconds. I've been reading on Comet and I'm just

polling a HTTP server from J2ME client

痴心易碎 提交于 2019-12-03 08:25:05
I have a J2ME app running on my mobile phone(client), I would like to open an HTTP connection with the server and keep polling for updated information on the server. Every poll performed will use up GPRS bytes and would turn out expensive in the long run, as GPRS billing is based on packets sent and received. Is there a byte efficient way of polling using the HTTP protocol?. I have also heard of long polling, But I am not sure how it works and how efficient it would be. Actually the preffered way would be for the Server to tell the phone app that new data is ready to be used that way polling

What's the best way to ping many network devices in parallel?

假如想象 提交于 2019-12-03 08:16:28
I poll a lot of devices in network (more than 300) by iterative ping. The program polls the devices sequentially, so it's slow. I'd like to enhance the speed of polling. There some ways to do this in Delphi 7: Each device has a thread doing ping. Manage threads manually. Learn and use Indy 10. Need examples. Use overlapped I/O based on window messages. Use completion ports based on events. What is faster, easier? Please, provide some examples or links for example. Flooding the network with ICMP is not a good idea. You might want to consider some kind of thread pool and queue up the ping

How do I JSON.parse an array in a Zapier Trigger?

谁都会走 提交于 2019-12-03 08:01:35
I am trying to JSON.parse the array "data." I need to be able to pass the array as the root. { "data": [ { "type": "name", "id": "123" } ] } The response should look like this containing only objects. Zapier doesn't seem to work well with arrays. { "type": "name", "id": "123" } Shouldn't I be able to use a simple script to get the job done? EDIT: Essentially, you're going to want to override the post_poll method ( https://zapier.com/developer/documentation/v2/scripting/#polling ) in scripting so you can intercept the response of the API. After that, you just need to return a new object with

Polling request for updating Backbone Models/Views

强颜欢笑 提交于 2019-12-03 07:15:00
问题 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 different time for discovering some change. I am wondering what is the most general way to: 1) implement the Traditional Polling Request 2) implement the Long Polling Request 3) implement the HTML5 web socket P.S.: 1) The server is written in PHP. 2)

Good C#.NET Solution to manage frequent database polling

一个人想着一个人 提交于 2019-12-03 06:51:59
I am currently working on a c# .NET desktop application that will be communicating to a database over the internet via WCF and WCF Data Services. There will be many spots in the application that may need to be refreshed upon some interval. The easiest solution would be to just put these areas on a timer and requery the database. However, with thousands of clients connecting to the service layer and hence database, these operations would be very expensive to the server. What I have considered is creating an RSS feed that is polled by the client, and lets the client know when these particular

Akka for REST polling

≡放荡痞女 提交于 2019-12-03 06:38:30
I'm trying to interface a large Scala + Akka + PlayMini application with an external REST API. The idea is to periodically poll (basically every 1 to 10 minutes) a root URL and then crawl through sub-level URLs to extract data which is then sent to a message queue. I have come up with two ways to do this: 1st way Create a hierarchy of actors to match the resource path structure of the API. In the Google Latitude case, that would mean, e.g. Actor 'latitude/v1/currentLocation' polls https://www.googleapis.com/latitude/v1/currentLocation Actor 'latitude/v1/location' polls https://www.googleapis

How do I do realtime database polling in MySQL/PHP?

£可爱£侵袭症+ 提交于 2019-12-03 06:25:44
问题 I have a Ruby script which is constantly updating a MySQL database. I want to show the " mysql_num_rows() " in realtime. So as an entry is entered into the database by the Ruby script I want the PHP script to update its mysql_num_row() count in realtime. I tried using <meta http-equiv="refresh" content="5"> , but I don't think this is the best solution. Does any one have a better solution? 回答1: Use JavaScript on the page to periodically make a call to the server and get some data. Using the

polling vs long polling

☆樱花仙子☆ 提交于 2019-12-03 05:55:21
问题 I got onto these examples showing polling vs long-polling in javascript, however I do not understand how they differ from one another. Especially regarding the long polling example, how does it keep its connection open? This is what the traditional polling scenario looks like: (function poll(){ setTimeout(function(){ $.ajax({ url: "server", success: function(data){ //Update your dashboard gauge salesGauge.setValue(data.value); //Setup the next poll recursively poll(); }, dataType: "json"}); }

polling api every x seconds with react

不想你离开。 提交于 2019-12-03 05:36:24
问题 I have to monitoring some data update info on the screen each one or two seconds. The way I figured that was using this implementation: componentDidMount() { this.timer = setInterval(()=> this.getItems(), 1000); } componentWillUnmount() { this.timer = null; } getItems() { fetch(this.getEndpoint('api url endpoint")) .then(result => result.json()) .then(result => this.setState({ items: result })); } Is this the correct approach? 回答1: Well, since you have only an API and don't have control over