Questions tagged [queue]
A queue is an ordered, first-in-first-out data structure. Typical implementations of queues support pushing elements to the back and popping them off the front position.
11,157
questions
-1
votes
0
answers
38
views
Why does my if condition/function does not work properly?
I am trying to build a system where the messages recieved from telegram telethon library are filtered out and put in to a database when it the message contains certain information, but for some reason ...
-1
votes
0
answers
23
views
Julia Simulation Code - Entities Skipping and Output Issue
I'm working on a simulation code in Julia that models a system with multiple machines and entities moving through them. I've encountered two issues in my code, and I'm seeking help to resolve them.
...
0
votes
1
answer
23
views
Program using Asyncio with queue ends before consumer finishes
I have the following producer pattern where I obtain data from a source, place it in queue, then consume it and write it to a CSV file. However, the program seems to end early because my tasks are all ...
0
votes
1
answer
17
views
At what point to create queues in messages broker?
At what point is it customary to create queues in message brokers? For example, I have a RabbitMQ in my application, and accordingly I need to create queues before launching it.
I'm still thinking ...
1
vote
1
answer
25
views
Python: setting queue with threading, how to?
I have a fetcher.py that reads URLs from urls.txt file and do some work with help of multithreading. When URLs are read from a txt file, a queue is formed, which is then used by threads. Since the ...
1
vote
1
answer
35
views
Error in executing task: 'javax.jms.Session javax.jms.Connection.createSession(boolean, int)
I followed this blog and tried to configure Oracle AQ with WSO2 Micro Integrator 4.2.0. There I created proxy service and inbound endpoint as explined in the blog. But I'm getting the below error.
...
-1
votes
1
answer
42
views
How to efficiently consume messages from an Amazon Simple Queue Service (SQS) in Golang? [closed]
I want to create an consumer in Golang but theres a few articles and info about it.
So i'm accepting any suggestion about how to do in a reliable way!
I tried using channels and some work arounds but ...
-2
votes
0
answers
12
views
If I want to implement a data stack in python with chained allocation, what type should I use?
I don’t know much about chained allocation, so this topic has been really confusing to me. Also, can I use the same type if I want to implement a queue? Consider that the algorithm is O(1).
I could ...
0
votes
0
answers
37
views
Exercise on queue in java
import java.util.LinkedList;
import java.util.Queue;
import java.util.Random;
public class TestQueueTwo {
public static void main(String[] args) {
Random random = new Random();
...
0
votes
1
answer
29
views
Queuing sessions into the database
I am trying to create an API that update data in the database Postgres SQLAlchemy with each request.
Each request recieved will call an update function that create a session using sessionmaker(), ...
0
votes
0
answers
28
views
ERROR when trying to configure Oracle AQ with WSO2 Micro Integrator
I'm trying to configure Oracle AQ with WSO2 Micro Integrator 4.2.0. I created oracle Queue and I was able to send and messages there. Howver when I tried to configure it with WSO2 MI and trying to ...
-2
votes
0
answers
39
views
Why did the shared hosting get slowed down by the Cron Job? What caused this? [closed]
I have set up this cron job to manage queue:work for my Laravel application on the shared hosting.
/usr/local/bin/php /home2/xxxxxxxxx/public_html/artisan queue:work --stop-when-empty > /dev/null 2&...
0
votes
0
answers
22
views
Redirect output and error to the same file using ProcessExecutor
I am using ProcessExecutor org.zeroturnaround.exec.ProcessExecutor, for executing a shell script in Java. The requirement is to to color code any error logs from the execution and write the output ...
-2
votes
0
answers
73
views
Move message from multiple storage account to other accounts [closed]
I have requirements where I need to move message from multiple storage account queues to other storage account queues. Basically, we need to migrate messages from one SA to other SA where as each SA ...
0
votes
1
answer
33
views
Questions about the Queue insertion and deletion algorithm
I'm not sure what "rear = -1" is in the queue algorithm of the image. And if you proceed with the insertion in the form of a queue as shown in the picture, does the 'front' move and point to ...
0
votes
0
answers
8
views
How to architect a queue for limiting concurrency to another service
We're building a backend which needs to make requests to a separate service, but the service can only handle X number of concurrent requests. How can I setup a queue or other architecture to throttle ...
0
votes
0
answers
32
views
How to Implement Custom Queue (Typescript) and NodeJS Cluster
I'm implementing a custom Queue Data Structure with Typesript and populating it in index.ts file. After clustering the node, I would like to run getMovie() function in every cluster in parallel.
But ...
0
votes
1
answer
46
views
Is there a way to solve or fix the codes of my Exercise20_23.java for Revel?
I'm trying to make that Exercise20_23.java work but it is not working.
I tried this;
import java.util.*;
public class Exercise20_23 {
public static void main(String[] args) {
Scanner scanner ...
0
votes
0
answers
16
views
Can we push data to Openremote
I was recently exploring OpenRemote. I have created a basic HTTP agent for my API.
But I was wondering if Openremote provides any API on its own that can help me push data to OpenRemote rather than ...
0
votes
1
answer
15
views
Is implementing a BFS with a stack instead of a queue the same as performing a DFS?
Typically, a BFS is implemented with a queue, so that you can traverse level by level. Would using a stack instead of a queue cause the algorithm to become just a DFS without recursion?
I'm thinking ...
-1
votes
0
answers
33
views
Purge print queue in .NET6 [duplicate]
There is the System.Printing.dll for .net framework applications.
And if I use "System.Printing" namespace, the following code works just fine
using (var ps = new LocalPrintServer(...
0
votes
0
answers
46
views
What does segmentation fault mean in this context? [duplicate]
I am working on a program that schedules a number of non-interactive jobs in the background based on a number given by the user. Afterwards, the user is meant to use keywords such as "submit"...
-1
votes
0
answers
15
views
Prevent ddos of websocket requests
A botter can easily ddos a nodejs application by connecting to the websocket multiple times in a short period of time. How can I prevent this?
1
vote
1
answer
65
views
Python SimpleQueue not fair
The Python standard library provides two implementations for the thread-safe SimpleQueue:
A pure C implementation
A fallback Python implementation, IIUC in case Cython is not present (and because ...
0
votes
0
answers
27
views
Queue theory: how to recognize Agents in data?
I'm dealing with the queueing-tool library for stimulate a one-node M/D/1 system where requests arrive with the arrival time defined as follows:
def slow_arr(t): return t + random.expovariate(1.5)
and ...
0
votes
0
answers
18
views
Npm Kue Separate Queue per Company
In my application there are multiple Companies.
And every company sends email.
The problem is that I have just one kue process to send all the mails.
So, if one company is sending email for say 10 ...
0
votes
1
answer
37
views
I have two queueable jobs running in a transaction how to resolve it
On Order Product object I have an integration with a 3rd party system, which sends data the 3rd party whenever the Order Product through Queueable class.
Now I am trying to insert a set of records to ...
0
votes
0
answers
15
views
How do you make Laravel queue run automatically using Forge and Ubuntu?
My queue jobs never reach the handle() function, though the construct() function is called just fine. I have a queue called "api" and I am sending the jobs to that queue. Supervisor is set ...
2
votes
1
answer
52
views
Async ordered queue executer in js
I have NodeJS app where I connect WS server, listen for new messages -
and on each message I do aysnc job.
The problem:
the jobs takes time - and I want to run them one at a time and in the order they ...
0
votes
0
answers
29
views
Is it possible to send frames from picamera2 to a queue and then create a file using 10 seconds worth of those frames?
I want to be able to record frames using picamera2 on the pi camera module 3 and send them to a thread message queue. When in this queue i want to join them and when the file reaches 2 minutes long i ...
0
votes
2
answers
219
views
Implement Queue using Linked List in C
This code is used to implement queues and some operations in C by using a linked list. I get unexpected output, especially the line "After removing front item: ", but I don't know why.
Here ...
0
votes
0
answers
33
views
How to remove some jobs from running in Laravel
I have one worker currently running, utilizing SQS with Laravel Jobs.
Within my jobs, I invoke third-party services to perform actions on my products. Each job corresponds to a specific product (e.g., ...
1
vote
0
answers
60
views
Queueing tasks to run one after the other
I have a scenario where I want to perform a long running operation as task on a worker thread, to produce a result that will be displayed on the UI thread.
However, the service being used for the long ...
0
votes
0
answers
38
views
Laravel Jobs and Telescope Package
I'm using the Telescope package in my Laravel app to monitor requests, and I have multiple jobs set up with the queue_connection configured to use the database.
here is how the job is added to the ...
0
votes
2
answers
87
views
Problems with locking single producer, multiple consumer fifo queue
I have this little simple queue where a one task read from a file into the queue and several tasks unpack the content. I works for a while, but eventually crashes because the queue is empty even ...
0
votes
0
answers
74
views
Enqueue and Dequeue Functions
So short context, I need to dequeue my elements of the queue and enqueue them to a temporary queue. When the original queue is empty and the elements are inside the temporary queue, I need to enqueue ...
1
vote
1
answer
59
views
Inserting a number into a circular queue causes an infinite loop
I'm working on a C program that implements a queue, and I'm encountering an issue with an infinite loop.
The program is supposed to perform insertion, traversal, and deletion operations on the queue.
...
1
vote
1
answer
34
views
Python: setting size of a queue in a multithreading script
I have a client.py script that reads URLs from txt file and send them to server. This script has multithreading for sending URLs. When URLs are read from a txt file, a queue is formed, which is then ...
1
vote
1
answer
39
views
asyncio.Queue - put urls from txt file
I need to pass URLs from txt file to the script that fetch URLs and do some work with the help of aiohttp and asyncio. So I use asyncio.Queue to put URLs from txt file into queue. The nuance is that ...
0
votes
1
answer
59
views
Is this pseudocode for implementation of a queue through an array valid?
Write a pseudocode on implementing a queue through an array named Q of size n with 1-based indexing( i.e the index of Q starts from 1 instead of the usual 0).
The two functions below called Q.head and ...
2
votes
1
answer
54
views
Replace a BlockingQueue + daemon thread with an Executor
I have a BlockingQueue with tasks, and a single daemon thread executing them:
public class TaskManager {
private final BlockingQueue<Task> taskQueue;
public TaskManager() {
this....
1
vote
1
answer
29
views
Chronicle Queue
Chronicle Queue:
How to sink between two queue in two different pods?
Synchronised between two queue in different pods?
Now considering there are two kubernetes pod writing data to Chronicle Queue on ...
0
votes
0
answers
30
views
Different number of enqueued messages between queue and its corresponding mirror
We have an ActiveMQ cluster with 2 nodes. We want to have a mirror queue to forward all messages sent to a specific queue to its mirror one. The following config is used for clustering which uses ...
1
vote
2
answers
77
views
creating a stack using two queues in c, dequeue is not working
So I am creating a stack using two queues in C.
And I am given enqueue, dequeue and printQueue.
Unfortunately my dequeue for one of my queues is not working properly, below is what I have written thus ...
0
votes
0
answers
58
views
Priority Queue - Explanation
as far as I know, a priority queue is a type of queue that arranges elements based on their priority values. Elements with higher priority values are typically retrieved before elements with lower ...
0
votes
0
answers
41
views
How to create multiple instances of a custom data structure in Linux 64-bit Asm?
I am using Linux x86-64 Assembly Language with the NASM assembler and Intel syntax.
I have written a functional, primitive single-ended queue that is implemented as an array of bytes like so:
...
0
votes
0
answers
11
views
INDEXERROR on Enqueue function (Python)
I'm writing the functions for enqueue and dequeue. I know I can use the built in functions, but I have to focus on the logic and working of these (am a 12 grade student) and so I need to write the ...
1
vote
1
answer
63
views
Python, logging with asyncio
Got stuck with logging exceptions in asyncio app.
Look at tke code below. It works, but it doesn't write anything to log file.
logfile='/tmp/test.log'
logger=logging.getLogger()
loghandler=logging....
0
votes
0
answers
23
views
Laravel: Send Notifications in a Batch
Explanation
I have a Notification that can have optional attachments. I would like the process to be:
user modifies text of notification and optionally attaches file
if file is uploaded, move it to ...
0
votes
1
answer
109
views
Simple flood fill algorithm in C to fill an array of integers
After trying my luck at implementing it in Fortran 90, I turned to C. I'm not sure whether it's my queue implementation or the actual flood fill algorithm but it doesn't work as expected and tends to ...