queue

Free Software Solution to continuously load a large number of feeds with several servers?

I need a system that schedules and conducts the loading of a large number of Feeds. The scheduling should consider priority values for feeds provided by me and the history of past publish frequency of the feed. Later the system should make use of pubsub where available. Currently I'm planning to implement my own system based on HBase an...

push in priorityqueue

I want to push some int to a priorityqueue but i can't! i used the queue.add() code but this code will return the sorted queue,please help,thank you! ...

Slowing down some Javascript

I have a large list of instructions that I need executed sequentially but slowly. One every ten milliseconds or so. I'm thinking about a queue type data structure but am unsure how to proceed. ...

Discard incoming UDP packet without reading

Hi, In some cases, I'd like to explicitly discard packets waiting on the socket with as little overhead as possible. It seems there's no explicit "drop udp buffer" system call, but maybe I'm wrong? The next best way would be probably to recv the packet to a temporary buffer and just drop it. It seems I can't receive 0 bytes, since man s...

Implementing a special type of multiprocessing queue in Python

Imagine an inverted binary tree with nodes A, B, C, D, E, F on level 0. nodes G,H,I on level 1, node J on level 2, and node K on level 3. Level 1: G = func(A,B), H = func(C,D), I = func(E,F) Level 2: J = func(G,H) Level 3: K = func(J,I). Each pair of nodes on Level 0 must be processed in order, Each pair of nodes on Level 1 can be ...

Using a queue in a multithreaded situation in C#

I just learned about queues in .NET and I have a few questions. Let's say that I'm building an application that downloads the HTML of pages and then processes it. Here's how I want it to operate: A main thread adds URLs to a queue This queue is read by two other threads. They "dequeue" a URL and then download the corresponding HTML. T...

Spring - Async Queue for sending mail

I have this: <si:poller max-messages-per-poll="10" id="defaultPoller" default="true"> <si:interval-trigger interval="5000"/> </si:poller> <si:channel id="emailIn"/> <si:channel id="emailOut"/> <si:service-activator input-channel="emailIn" output-channel="emailOut" ref="mailService" method="recieveMessage"/> <si:gateway id="gat...

Concurrent Set Queue

Maybe this is a silly question, but I cannot seem to find an obvious answer. I need a concurrent FIFO queue that contains only unique values. Attempting to add a value that already exists in the queue simply ignores that value. Which, if not for the thread safety would be trivial. Is there a data structure in Java or maybe a code snipit...

Python multiprocessing.Queue deadlocks on put and get

I'm having deadlock problems with this piece of code: def _entropy_split_parallel(data_train, answers_train, weights): CPUS = 1 #multiprocessing.cpu_count() NUMBER_TASKS = len(data_train[0]) processes = [] multi_list = zip(data_train, answers_train, weights) task_queue = multiprocessing.Queue() done_queue = mu...

Is this a good architecture / design concept for handling/manipulating file uploads?

Hi folks, I'm looking at adding multi-file uploading to our ASP.NET MVC web application. I am going to use the 3rd Party Multi-File uploader Aurigma to handle the actual uploading. Once each file is 100% received by the web server, it needs to be checked for the following is it an image or video. if it's an image, does it need to be...

Observable Stack and Queue

I'm looking for an INotifyCollectionChanged implementation of Stack and Queue. I could roll my own but I don't want to reinvent the wheel. ...

Looking for a job queue that can run jobs at a specified time

Hi, I'm looking for a job queue that has the following features: Can specify a specific future time for a job to be run Failures are recorded The ability to delete specific jobs from the queue (can live without this one but would be nice) Not MySQL based Works well with Rails So far I've looked at a few such as starling and sparrow ...

Immutable queue in Clojure

What is the best way to obtain a simple, efficient immutable queue data type in Clojure? It only needs two operations, enqueue and dequeue with the usual semantics. I considered lists and vectors of course, but I understand that they have comparatively poor performance (i.e. O(n) or worse) for modifications at the end and beginning re...

what design pattern to use for multiple throttled api requests?

I'm writing a web site that uses multiple web services with throttle restrictions. I.e. Amazon is 1 request per second, another is 5000/day another is x/minute. When a user does something, I need to trigger one or more requests to the above services and return the results (to the browser) when available. The solution need to be flexibl...

Advanced search/queue array collection question

I have a pretty large number of objects "usrSession" I store them in my ArrayCollection usrSessionCollection. I'M looking for a function that returns the latest userSessions added with a unique userID. So something like this: 1. search the usrSessionCollection and only return one userSessions per userID. 2. When it has returned x num...

Implementing a file based queue

Hi folks I have an in memory bounded queue in which multiple threads queue objects. Normally the queue should be emptied by a single reader thread that processes the items in the queue. However, there is a possibility that the queue is filled up. In such a case I would like to persist any additional items on the disk that would be proce...

Which file should I pass as pathname argument of ftok()

It is mentioned in ftok() manual key_t ftok(const char *pathname, int proj_id); The ftok() function uses the identity of the file named by the given pathname (which must refer to an existing, accessible file) ... I am confused about const char *pathname. What would be the best practice for it? On my current system I can pass "...

c++ STL queues, references and segmentation fault

Newbie to C++ learning by converting a java program to c++. The following code results in a segmentation fault (SIGSEGV) when executed. //add web page reference to pages queue (STL) void CrawlerQueue::addWebPage(WebPage & webpage) { pagesBuffer.push(webpage); } //remove and return web page reference from pages queue WebPage & Crawl...

JMS Destination creation at deployment with Glassfish 3.0.1

I'm currently trying to 'port' my Java EE 5 Application from Jboss 6 M2 to Glassfish 3.0.1 Jboss used to create my JMS Destination Queues a deployment-time thanks to the -service.xml files. I really liked this feature and I would like to find a way to do the same thing on Glassfish. Is this even possible ? ...

python threading and queues for infinite data input (stream)

Hi All, I would like to use thread to process a streaming input. How can make the below code for an infinite input generate for example by using itertools.count The code below will work if: 'for i in itertools.count():' is replaced by 'for i in xrange(5):' from threading import Thread from Queue import Queue, Empty import itertools...