473,396 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

persistent fifo queue class

I'm looking to see if there are any examples or prewritting fifo queue
classes. I know this is a broad topic. I'm looking to implement a simple
application where a web server enqueue and pickle using a local socket on
to a 'queue server' -- and then I will have another application dequeue the
pickles again using a local socket.

--
David Bear
-- let me buy your intellectual property, I want to own your thoughts --
Mar 5 '07 #1
4 2326
David Bear schrieb:
I'm looking to see if there are any examples or prewritting fifo queue
classes. I know this is a broad topic. I'm looking to implement a simple
application where a web server enqueue and pickle using a local socket on
to a 'queue server' -- and then I will have another application dequeue the
pickles again using a local socket.
Why don't you use a DB for that? If you want pickles, use a blob
column. But all the rest - a defined protocol, stable server,
transactions - you get for free.

Diez
Mar 6 '07 #2
Diez B. Roggisch wrote:
David Bear schrieb:
>I'm looking to see if there are any examples or prewritting fifo queue
classes. I know this is a broad topic. I'm looking to implement a simple
application where a web server enqueue and pickle using a local socket on
to a 'queue server' -- and then I will have another application dequeue
the pickles again using a local socket.

Why don't you use a DB for that? If you want pickles, use a blob
column. But all the rest - a defined protocol, stable server,
transactions - you get for free.

Diez
Thanks for the suggestion. I did think of this. Indeed the final destination
of the data is in a db. However, the postsgresql server is on a separate
box. It will be connected via a private lan. I was worried that possible
network disruptions would cause either the web application to hang -- or
data to just get lost. I was thinking along the lines is a message queue
architecture, where the web app would push data directly onto a queue --
and then a worker app would dequeue the data and handle it by sending it to
the db server or otherwise.
--
David Bear
-- let me buy your intellectual property, I want to own your thoughts --
Mar 7 '07 #3
"David Bear" <da....be**@asu.eduwrote:
Diez B. Roggisch wrote:
Why don't you use a DB for that? If you want pickles, use a blob
column. But all the rest - a defined protocol, stable server,
transactions - you get for free.

Diez

Thanks for the suggestion. I did think of this. Indeed the final destination
of the data is in a db. However, the postsgresql server is on a separate
box. It will be connected via a private lan. I was worried that possible
network disruptions would cause either the web application to hang -- or
data to just get lost. I was thinking along the lines is a message queue
architecture, where the web app would push data directly onto a queue --
and then a worker app would dequeue the data and handle it by sending it to
the db server or otherwise.
Have you looked at Pyro?

I think it could help to tie the boxes on the local LAN together,
with a 'Pusher' on the first box and a 'Popper' on the box where the
final DB lives. And Diez' DB could provide the persistence on the first
box.
The 'push' and 'pop' above are a bit of a misnomer, as Pyro will allow
you to have a 'puller' on the final DB box to front end the DB.
I think a "double DB" architecture like that will be very robust as
Diez' DB can provide a "transactions queued, in process, and
completed" log.

- Hendrik

Mar 8 '07 #4
David Bear schrieb:
Diez B. Roggisch wrote:
>David Bear schrieb:
>>I'm looking to see if there are any examples or prewritting fifo queue
classes. I know this is a broad topic. I'm looking to implement a simple
application where a web server enqueue and pickle using a local socket on
to a 'queue server' -- and then I will have another application dequeue
the pickles again using a local socket.
Why don't you use a DB for that? If you want pickles, use a blob
column. But all the rest - a defined protocol, stable server,
transactions - you get for free.

Diez

Thanks for the suggestion. I did think of this. Indeed the final destination
of the data is in a db. However, the postsgresql server is on a separate
box. It will be connected via a private lan. I was worried that possible
network disruptions would cause either the web application to hang -- or
data to just get lost. I was thinking along the lines is a message queue
architecture, where the web app would push data directly onto a queue --
and then a worker app would dequeue the data and handle it by sending it to
the db server or otherwise.
Well, if your DB connection is flaky, data will be corrupted - or lost.
In any case. What good does it do for you to have the messages then? And
what if the Harddisk the file sits on is corrupt? And don't forget the
added complexity of a home-brewn solution with all its possible errors -
much more likely to cause data loss.
Diez
Mar 8 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Luca | last post by:
I have the need of a container of integers showing both the characteristics of an associative container (all integer elements different from each other) and the FIFO behaviour. Do you know if...
2
by: worli | last post by:
Hi All, I have a strange requirement. I have a dynamic input numeric data stream e.g. 2, 2, 4, 5 etc.... ( each input number range from 1 to 10 ). lets take a simple case where all inputs will...
2
by: Michele Moccia | last post by:
How can I implement a "time critical" fifo in c++ ? I just have to manage sequences of raw bytes, no user defined types. An std::queue<unsigned char> or std::deque<unsigned char> seems to be slow....
8
by: Jack | last post by:
I want to implement a fixed-size FIFO queue for characters. I only want to use array not linked list. For example, const int N = 10; char c_array; The question is when the queue is full,...
5
by: Dinsdale | last post by:
I have an application that recieves text data via external input (i.e. serial) and displays it on the screen (we use carraige return as a delimiter). At this point I use a regular old text box and...
4
by: drochom | last post by:
hi, how would u improve this code? class queue: def __init__(self, size=8): self.space = size self.data = *self.space self.head = 0 self.tail = 0
0
by: kmoeWW | last post by:
Hi all, I'm using the PICC CCS C compiler and am having issues with starting an enque/deque for my program. What I need it to do is to hold about 9 data packets, each packet is an array of 4 HEX...
2
by: Spoon | last post by:
Hello, I'm wondering whether the STL defines a data structure with the following features: o provides push_front() and pop_back() (like std::list) to implement a FIFO buffer. o allows fast...
5
by: akenato | last post by:
Hi for me this is th first time that I use c++. I have to do this exercise. Somebody can help me? Thanx. Implement a FIFO-queue ( first in, first out ) as a ring buffer. Use a static array as the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.