queue

How do I store javascript functions in a queue for them to be executed eventually

Hi, I have created a Queue class in javascript and I would like to store functions as data in a queue. That way I can build up requests (function calls) and respond to them when I need to (actually executing the function). Is there any way to store a function as data, somewhat similar to .setTimeout("doSomething()", 1000); except it...

Building a scalable ASP.NET MVC Web Application

I'm currently in the process of building an ASP.NET MVC web application in c#. I want to make sure that this application is built so that it can scale out in the future without the need for major re-factoring. I'm quite keen on using some sort of queue to post any writes to my database base to and have a process which polls that queue ...

What is the correct term for a fixed sized FIFO queue?

What is the correct name for the following data structure? It is: A queue of fixed size New elements are added to the start Whenever the queue gets above a certain size a number of elements are removed from the end ...

Event / Task Queue Multithreading C++

I would like to create a class whose methods can be called from multiple threads. but instead of executing the method in the thread from which it was called, it should perform them all in it's own thread. No result needs to be returned and It shouldn't block the calling thread. A first attempt Implementation I have included below. The ...

python queue & multiprocessing queue: how they behave?

This sample code works (I can write something in the file): from multiprocessing import Process, Queue queue = Queue() def _printer(self, queue): queue.put("hello world!!") def _cmdDisp(self, queue): f = file("Cmd.log", "w") print >> f, queue.get() f.close() instead this other sample not: (errormsg: 'module' object i...

Queuing and stop propogating a click event to inside a div in Javascript

I'm trying to implement a "wait for 3 seconds to do this operation" <div>. So, I have a <div> that has a bunch of elements in it that I want to be unclickable for say 3 seconds (a timer, or some other event), but somehow capture the events in a queue, and then fire them after the period (or some event of my choice) has elapsed/performed...

Terminology/naming convention for queue operations/APIs?

The "queue", or FIFO, is one of the most common data structures, and have native implementations in many languages and frameworks. However, there seems to be little consensus as to how fundamental queue operations should be named. A survey of several popular languages show: Python: put / get C#, Qt : enqueue /dequeue Ruby, C++ STD: p...

Modifying a Swing Timer's Delay during Runtime

I'm developing a Queue simulation, using a Swing Timer to dequeue objects after certain amounts of time. The interval is determined by peeking at the next object in the queue, getting an integer from it, and setting the delay of its corresponding timer. Here's the relevant snippet from the program (Note: _SECONDS_PER_ITEM is a constant ...

Why does std queue not define a swap method specialisation

I've read that all stl containers provide a specialisation of the swap algorithm so as to avoid calling the copy constructor and two assignment operations that the default method uses. However, when I thought it would be nice to use a queue in some code I was working on I noticed that (unlike vector and deque) queue doesn't provide this ...

building a url queue

Which is better for building a URL queue in large scale web crawler. Linked-list or or B-tree? ...

SQL Server Process Queue Race Condition

I have an order queue that is accessed by multiple order processors through a stored procedure. Each processor passes in a unique ID which is used to lock the next 20 orders for its own use. The stored procedure then returns these records to the order processor to be acted upon. There are cases where multiple processors are able to ret...

Finding on item in a circular queue?

I have a circular queue of ordered items. How to find whether or not an item with the value of x is in it? What is the best way (algorithm) to do this? ...

What technologies are suitable for building Queue Management Systems?

I figure out some technologies that can help me to build Queue Management Systems. Each terminal will send multicast to others. All the terminals get messaging in sync in real time. I'm not sure that do I really need a database server as backend or not? ...

.Net 3.5 CompactFramework Stack

All, I need a high speed stack on a .Net CF platform (ARM chip). Does anyone know if the standard (managed) queue classes work well enough for what I describe below? Anyone got an idea on how fast they are? If I do not used managed memory classes what should I use? The stack will need a maximum size (in megabytes ... 10 or 20 ... so mem...

Consuming a queue's messages with the processing resource varying by message type

I'm having some trouble putting together an algorithm for an asynchronous queue consumer thread, that is reading items off of a single queue that need to be dispatched to do some long running (several seconds at least) work. Basically the queue can look as follows: A, A, A, A, A, B, B, A, B, A, A, A, A, A, C, B, A. Ie. the A messages a...

Is there a better way to wait for queued threads?

Is there a better way to wait for queued threads before execute another process? Currently I'm doing: this.workerLocker = new object(); // Global variable this.RunningWorkers = arrayStrings.Length; // Global variable // Initiate process foreach (string someString in arrayStrings) { ThreadPool.QueueUserWorkItem(this.DoSomething, ...

Get notification when NSOperationQueue finishes all tasks

NSOperationQueue has waitUntilAllOperationsAreFinished, but I don't want to wait synchronously for it. I just want to hide progress indicator in UI when queue finishes. What's the best way to accomplish this? I can't send notifications from my NSOperations, because I don't know which one is going to be last, and [queue operations] migh...

Task Queue API: ETA and Countdown

I love the new TaskQueue API. I have a question about the ETA/Countdown, if I set it a new Task to execute 10 minutes in the future and it is the only item in the queue - will it execute in roughly 10 minutes or will it execute straight away? ...

What is the syntax for creating a queue subscriber in PL/SQL?

I'm trying to create a queue and a callback that triggers when a message is queued, but I can't get the callback to trigger. What am I doing wrong? I have a trigger that enqueues a message, and I can see it on the queue message table, and I can dequeue it by hand and process it, I just can't get the callback to fire on enqueue. BEGIN ...

java how to do a sender thread

Hi all, I was told that any data going out over an output stream (i'm using tcp/ip in my case) could block. In that case, I would not want to halt the application by having to wait for data to go out. I need a model of how to do this. I need to send message objects over this stream. I am thinking I need a blocking queue that conta...