polling

Detect a file in transit?

ε祈祈猫儿з 提交于 2019-12-08 01:32:34
问题 I'm writing an application that monitors a directory for new input files by polling the directory every few seconds. New files may often be several megabytes, and so take some time to fully arrive in the input directory (eg: on copy from a remote share). Is there a simple way to detect whether a file is currently in the process of being copied? Ideally any method would be platform and filesystem agnostic, but failing that specific strategies might be required for different platforms. I've

JQuery AJAX Polling Syntax

百般思念 提交于 2019-12-07 16:40:55
问题 I'm a bit green, so please bear with me. I need to poll a SharePoint webservice until it returns a value. I believe that I have formatted my code incorrectly. If there is a pre-existing thread that addresses this, please point me to it; my relatively limited understanding may have kept me from recognizing it. function Poll2(){ $.ajax({ //Use an ABSOLUTE reference to your target webservice url: "https://mydomain.com/Sandbox/bitest/_vti_bin/lists.asmx", type: "POST", dataType: "xml", data:

Poll the Server with Ajax and Dojo

孤街醉人 提交于 2019-12-07 12:04:54
问题 I'm using dojo.xhrPost to sent Ajax Requests The call is wrapped by a function sendRequest() I've now to continuously (every 3sec) send the same ajax Post to the server How can I implement a Server Poll with Dojo? I basically need to call sendRequest() every 3 secs 回答1: I don't believe that Dojo has a method built-in for polling, so here's a generic method that's applicable across frameworks var Poll = function(pollFunction, intervalTime) { var intervalId = null; this.start = function

React redux api polling every x seconds

匆匆过客 提交于 2019-12-07 01:40:30
问题 I've got this working but i'm after a more 'best practice way'. its using the https://icanhazdadjoke api to display a random joke that gets updated every x seconds. is there a better way of doing this? eventually i want to add stop, start, reset functionality and feel this way might not be the best. Any middleware i can use? Redux actions // action types import axios from 'axios'; export const FETCH_JOKE = 'FETCH_JOKE'; export const FETCH_JOKE_SUCCESS = 'FETCH_JOKE_SUCCESS'; export const

Interthread communication

谁都会走 提交于 2019-12-06 16:32:54
The following question is about the unity game engine, but it could relate to any program trying to send data to a main thread, such as the UI thread. I am processing some data on a separate thread (position data a read asyncrously from a socket). However, I need to act on this data on the main thread (a game object's transform can only be accessed from the main thread). The approach I have in mind is to create a thread-safe queue and follow the producer-consumer pattern. The thread would queue the position data and the main thread would deque the data and act on it. *Note: In Unity I do not

angular dot notation better explanation

a 夏天 提交于 2019-12-06 14:18:01
问题 I was looking for a solution about polling data using AngularJS and I found here at stackoverflow. In this solution (shown bellow) it is used a javascript object to return the response ( data.response ) and if I try to replace that data object for a simple javascript array it doesn't work , I would like to know exactly why I need to go with dot notation and why a single array doesn't work? (It would be great links or explanation with examples) app.factory('Poller', function($http, $timeout) {

Detect a file in transit?

孤街醉人 提交于 2019-12-06 11:18:50
I'm writing an application that monitors a directory for new input files by polling the directory every few seconds. New files may often be several megabytes, and so take some time to fully arrive in the input directory (eg: on copy from a remote share). Is there a simple way to detect whether a file is currently in the process of being copied? Ideally any method would be platform and filesystem agnostic, but failing that specific strategies might be required for different platforms. I've already considered taking two directory listings separaetd by a few seconds and comparing file sizes, but

chat application on appengine

前提是你 提交于 2019-12-06 09:42:26
I am willing to implement a chat website on App Engine. But I found that App Engine will not allow me to go with server push. (as it will kill the response after 30 sec). So whats the other method that can be used? Will polling cause bad user experience? Meaning will the user have to wait for some time to retrieve new messages from the server? What will be the ideal polling interval? If you use very small polling intervals, will my bandwidth get exhausted? Will I suffer performance problems? This is a quite old question now, but I was looking for a similar answer. I think the Channel API (

Polling I/O (MIPS)

放肆的年华 提交于 2019-12-06 08:23:42
I am attempting to write a program in MIPS that uses polling to read a character from the keyboard and then displays it using the builtin Keyboard and Display MMIO Simulator. Unfortunately, I am having trouble grasping the concept behind the registers used and the control bits, but have been trying to figure it out from examples online. Here is what I have written so far: .data .text .globl main main: .eqv RCR 0xffff0000 # Receiver Control Register (Ready Bit) .eqv RDR 0xffff0004 # Receiver Data Register (Key Pressed - ASCII) .eqv TCR 0xffff0008 # Transmitter Control Register (Ready Bit) .eqv

BizTalk - Receive Port reading twice from DB

醉酒当歌 提交于 2019-12-06 07:00:00
问题 My receive port is of sqlBinding and typed polling. It invokes a SP to fetch a record and based on filter condition the corresponding orchestration kicks off. The BizTalk group consists of 2 servers; thus 2 ReceiveHostInstances. If both the host instances are running -at some point the same request is being read twice - causing a duplicate at the receivers end. But, why is the reeive port reading it the same record more than once? The proc which reads the updates the record and updates it so