polling

How to prevent PrimeFaces poll from clearing FacesMessages?

穿精又带淫゛_ 提交于 2019-11-28 07:33:21
问题 I'm using PrimeFaces poll component to refresh some content. <h:form id="formBsvtt"> <p:messages autoUpdate="true" showDetail="false" /> <p:outputPanel id="panelOut" layout="block"> ... ... content to refresh ... </p:outputPanel> <p:panelGrid id="panelIn" layout="block"> ... ... various input components with validation ... </p:panelGrid> <p:poll widgetVar="poll1" autoStart="true" global="false" interval="15" partialSubmit="true" process="@this" update="panelOut" listener="#{myBean.myListener}

Comet VS Ajax polling

∥☆過路亽.° 提交于 2019-11-28 07:03:12
I need to create a chat like facebook chat. With Comet I need more memory to keep the connection. With Ajax polling there is a latency problem if I send request every 3-4 seconds. So... If the latency ( 3-4 seconds ) doesn't matter, Is Ajax Polling better for my case ? Latency is not the only problem. COMET (long-polling) "saves" your traffic - when you use polling, you cannot know, if there were changes on the server, so some of the calls may be just a waste of traffic and resources (e.g., even if no one's chatting, you're making calls every 3-4 seconds). In case of COMET, you generally need

App architecture when 'state changing' APNS fails

邮差的信 提交于 2019-11-28 06:38:19
问题 I've seen several questions on this topic. But all simply say you just have to recover from other means. But none explain what the other means are! I couldn't find an answer on SO. This is also a follow up from the comments of this question. Let's say I'm working on a Uber app. Drivers need to know passenger locations. A passenger sets a pickup location for 123 XYZStreet . 2 minutes later she decides to cancel the entire pickup. So now I need to inform the driver. This is an important state

Socket connections and Polling. Which is a better solution in terms of battery life?

只愿长相守 提交于 2019-11-28 03:56:10
So... I'm making an application for Android. The application needs to send and receive realtime chat data (needs to be a socket) but it also needs to send commands (which don't as the client knows when it is sending something). I need to know what is a better solution in terms of saving the user's battery. a) Opening and Closing the connection every time a command is sent, if the chat tab is opened then keep the connection constant. b) Keep the connection constant all the time. I've taken a look around the internet but have gotten mixed answers, some say keeping a persistent connection is bad

Android Polling from a Server periodically

青春壹個敷衍的年華 提交于 2019-11-27 16:47:37
问题 I want to pull some data from a server every x minutes. IF the info contains certain information I would like to create a notification. I want this polling to happen even when the app is in the background, or the phone is asleep. I have a few questions about polling in android. What is the best way to go about doing it? Should I use an IntentService, an AlarmManager, something else? How often should I be polling the data? I would like to keep it relatively often, say under every 10 minutes.

Getting historical data from Twitter [closed]

大兔子大兔子 提交于 2019-11-27 14:29:43
For a research project I would like to get the last 3 months worth of Twitter messages. Technical challenges aside, is this possible? by using some sort of slow polling mechanism to keep the rate limiter at bay? The Twitter API states "Clients may request up to 3,200 statuses via the page and count parameters for timeline REST API" Are these per hour? Per day? or...ever? Any suggestions? Would it even be theoretically possible? Did some one do something similar before? Thanks! Marco Twitter notoriously does not make "available" tweets older than three weeks. In some cases you can only get one

How To Do Polling with Angular 2 Observables

安稳与你 提交于 2019-11-27 13:55:57
问题 Given the following code, how to I alter it to make the get request to "api/foobar" repeat every 500 milliseconds? import {Observable} from "RxJS/Rx"; import {Injectable} from "@angular/core"; import {Http} from "@angular/http"; @Injectable() export class ExampleService { constructor(private http: Http) { } getFooBars(onNext: (fooBars: FooBar[]) => void) { this.get("api/foobar") .map(response => <FooBar[]>reponse.json()) .subscribe(onNext, error => console.log("An error occurred when

What is the difference between busy-wait and polling?

佐手、 提交于 2019-11-27 13:15:16
问题 From the Wikipedia article on Polling Polling, or polled operation, in computer science, refers to actively sampling the status of an external device by a client program as a synchronous activity. Polling is most often used in terms of input/output (I/O), and is also referred to as polled I/O or software driven I/O. Polling is sometimes used synonymously with busy-wait polling (busy waiting). In this situation, when an I/O operation is required the computer does nothing other than check the

How to display loading percentage and how to do it without javascript?

随声附和 提交于 2019-11-27 12:34:27
问题 I want to make something similar to loaders in PHP so I used this code: <?php $x=1; while($x<=100) { echo "Loading: $x %<br>"; $x++; } ?> So that it would display from "Loading 1%" to "Loading 100%". But this will result in all appearing one at a time without disappearing after the new line appears. So I want to know how to make the new line appear and the old disappear and this starts after the page loads, so the user will be able to watch a loader actually loading from 1% to 100%. UPDATE: I

Serial Port Polling and Data handling

懵懂的女人 提交于 2019-11-27 04:42:34
I am trying to read from several serial ports from sensors through microcontrollers. Each serial port will receive more than 2000 measurements (each measurement is 7 bytes, all in hex). And they are firing at the same time. Right now I am polling from 4 serial ports. Also, I translate each measurement into String and append it to a Stringbuilder. When I finish receiving data, they will be ouput in to a file. The problem is the CPU consumption is very high, ranging from 80% to 100%. I went though some articles and put Thread.Sleep(100) at the end. It reduces CPU time when there is no data