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.
10,639
questions
0
votes
0
answers
14
views
Deadlock in a Python multiprocess application using Logging cookbook example
I need to use logging in a multiprocess application. As explained in documentation one method is to use the couple QueueHandler/QueueListener but I stumbled in deadlock problem. So, I started from the ...
-1
votes
0
answers
14
views
Can not find symbol : Function Symetric queue java [duplicate]
I can not get what is the reason of the compilation error..
The error:
Main.java:37: error: cannot find symbol
queue2.insert(num2);
symbol: method insert(int)
location: ...
0
votes
0
answers
20
views
Azure service bus queue AutoLockRenewer seems to be failing to renew the lock
I am running a python code which listens to an azure servicebus queue
The actual processing of a message can be sometimes long (~10 minutes or more)
The lock duration on the queue settings is 3.5 ...
0
votes
0
answers
7
views
How to organize scheduled data polling during the application scaling?
I have a microservice that among other things is used as a "caching proxy" (I'm not sure that this term is correct). It is in between the application API and Azure API. This microservice ...
1
vote
1
answer
39
views
How can I print all the elements in a Generic Linked List Queue?
This is the current method I'm working with. newt is the name of the Generic LinkedList Queue.
newt.peek() returns the data inside of the head of the queue.
I'm not sure how to go through each element ...
0
votes
0
answers
18
views
In Laravel, defer database updates to end of week, and be able to view pending updates in browser
I have a Laravel app where users can perform basic CRUD operations on data. However, the data must remain unchanged during the week. CRUD requests should be logged and executed in bulk at the end of ...
0
votes
0
answers
14
views
Queue&Thread: different behaviour for Queue.empty()&Queue.full() with/without time.sleep(tiny_second)
from queue import Queue
import threading
import time
q = Queue(maxsize=1)
def print_list():
for i in list(range(0, 100)):
while q.empty():
print("-----put element in ...
0
votes
0
answers
39
views
NOT_FOUND when adding tasks to Google Cloud Tasks
I'm getting an error called NOT_FOUND while adding tasks to Google Cloud Tasks from the Firebase Functions. It's only 1 task that I tried to add. Not sure why this is happening.
The queue is present ...
-3
votes
0
answers
13
views
API call queueing
I want to integrate third party API. But I want to do the API calls through some queue so that, even if the third party server is down, it will automatically retry like celery. Can you guys please ...
0
votes
3
answers
65
views
Thread-safe fixed-size circular buffer with sequence ids
I need a queue with these capabilities:
fixed-size (i.e. circular buffer)
queue items have ids (like a primary key), which are sequential
thread-safe (used from multiple ASP.NET Core requests)
To ...
-2
votes
0
answers
32
views
How Map and Hashtable uses storage? [closed]
I know that Arraylist, Stack, Queue, Vector reserves the storage (in order to add more elements in future). Also, I know that LinkedList and Tree don't reserve, they just take free storage, because ...
0
votes
0
answers
48
views
Weird behavior when using a queue to store buffer data in producer-consumer multithreading program
I created a small program where a producer thread creates a random number and pushes it to a stack, then a consumer thread pops the stack and prints out the value to the console. I created 2 ...
0
votes
2
answers
53
views
ConcurrentQueue with items that have sequence value
I'm using a ConcurrentQueue<Result> to store results of a certain activity that occurs in my system (ASP.NET Core 6). It works well.
But now I have a new requirement: I need a Result.Id property ...
0
votes
0
answers
24
views
is there a good way in python to have a queue shared between threadpool with process pool?
i have two modules and they share with queue, but module one i use multiple thread to put message in this queue, and module two i fetch the message by multiple Process, how to implement a queue like ...
0
votes
0
answers
15
views
Value for parameter MessageDeduplicationId is invalid. Reason: The request includes a parameter that is not valid for this queue type
I have a queue in SQS running locally via localstack. I already configured my .env to talk to my indexer and my api. But when I run it gives me this message Value I4nCE8HRz0M for parameter ...
0
votes
1
answer
26
views
send multiple emails using custom job in laravel
I tried to create a job in order to send emails to all users in the database I have done everything and connected successfully with Mailtrip but still have a problem : (Failed) when implementing the ...
2
votes
0
answers
44
views
Getting data with Pending status from redis
Good afternoon. I am trying to solve a queue problem with radis stream.
Task description: we need to implement a queue to store the data that we will send to the user's email.
How it works: I have a ...
0
votes
1
answer
40
views
Send an Alert to user based on changes in the database row
There are 10, 000 users. Each can define up to 500 conditions for an enterprise supply chain inventory.
An example of a condition could be
Group1
Item in InventoryX > 5000 AND colourItem == Red
AND ...
0
votes
0
answers
24
views
Python: Callback on the worker-queue not working
Apologies for the long post. I am trying to subscribe to rabbitmq queue and then trying to create a worker-queue to execute tasks. This is required since the incoming on the rabbitmq would be high and ...
0
votes
1
answer
68
views
I have to sort a stack in ascending order from top to bottom using only one queue
def stack_push(stack, a, size):
if isfull(stack, size):
print("Error, stack is full")
return stack
else:
stack.append(a)
return stack
def stack_pop(...
0
votes
1
answer
32
views
Python: will a thread ever unblock while hanging on a `Queue.get(block=True)` call if the queue is suddenly destroyed from another thread/process?
TLDR: Would a blocking get be unblocked by a queue that would be terminated in some way?
Long question:
Okay, so I know that the thread will hang if the queue (multiprocessing.Queue) remains empty ...
1
vote
0
answers
12
views
How to handle concurrent bids in an online auction?
I wanted to how the system handles the concurrent bids. There is a possibility that two bidders might bid the same amount at the same time even going down to the milliseconds (considering a large ...
0
votes
0
answers
14
views
How to set milliseconds of delivery delay on an AWS SQS FIFO queue?
I would like to set 85 milliseconds of delivery delay for each message on an AWS SQS FIFO queue.
After I set delivery delay field as 0.085, when I try to save queue settings, AWS shows a blank page ...
0
votes
0
answers
37
views
manage cyclic queue based data pipelines
Linear acyclic pipeline
I created a data pipeline based on this design pattern
to_read > |Extractor| > to_transform > |Transformer| > to_load > |Loader|
queue queue ...
0
votes
0
answers
9
views
How works findOneAndUpdate in php with mongodb in concurence case (concurrency control)
I used mongodb db.version() 5.0.9 with PHP 7.4.30
I worked with queue based on mongo db and in architecure present possibility to scaling, so could be several workers. My question - how I can protect ...
0
votes
0
answers
21
views
multiprocessing python and variables
i tried to check thread safe append() ? I'm not sure it's safe and write this.
I usually use threading and there I have a lot of code where I found that append() is not safe, although maybe I made a ...
0
votes
1
answer
18
views
Does request() helper work with laravel queue
I am trying to send email using laravel queue and database jobs table. In one of my file which is generating pdf which is attached with email has helper request()->organization, however it is ...
3
votes
2
answers
57
views
How do I queue incoming websocket events in javascript for slow execution?
I have an open Websocket connection and it's handing out events. All good, but once a new event arrives, I need to do a whole lot of things and sometimes events arrive so quickly one after the other ...
0
votes
2
answers
34
views
Share queue between processes
I am pretty new to multiprocessing in python and trying to achieve something which should be a rather common thing to do. But I cannot find an easy way when searching the web.
I want to put data in a ...
0
votes
2
answers
29
views
Laravel 8 Email not sent, job in queue execute but goes to failed job and return 2 types of error
I'm using supervisor to send email. At the first place all email was successfully sent using queue. All email goes into jobs table then executed.
Couple days ago I didn't get the notification email ...
0
votes
0
answers
17
views
How to explore the redis queue using redis-cli
I am new to redis and I want to know if there is any way to explore the redis queues usign redis-cli.
I recently picked up redis and I was surprised to find that there are many old entries that have ...
0
votes
0
answers
21
views
Laravel queue::after function is not working?
I want to add some additional functionality when the queue is finished. I am using the queue::after function in the AppServiceProvider but this function is not being triggered. I have tried many ...
0
votes
1
answer
41
views
Enqueue successful, but Queue prints nothing?
I am trying to enqueue data into a queue.
The enqueue appears to have been successful because the current Node's Thing pointer is not null. Indeed, its Thing id is 7 as expected. However, something is ...
0
votes
0
answers
33
views
consumer-producer with persistence in boost-asio
A slightly convoluted C++ asio program
This is a question about writing consumer-producer software with asio.
In a C++ program using asio, I have the following architecture:
The main thread. It ...
0
votes
2
answers
73
views
C# BlockingCollection loop on IsCompleted instead of GetConsumingEnumerable
In an application, many actions need to be logged in the database. but this logging process should not slow down the request. So they should be done in an asynchronous queue or something.
This is my ...
1
vote
2
answers
38
views
Getting garbage number automatically in the array while applying Queue
I was trying to make a queue program on my own, but when I enqueue an element and then display the queue, I find an extra element already lying around in my queue. Also, I am not able to add the ...
0
votes
1
answer
28
views
Python Threading or Multiprocessing- Data transfer
Iam working on a project which is a bit large.. i have -6-7 modules which generate/acquire different data through NI hardware, so i have a main ".py" file and different other files which ...
-1
votes
1
answer
28
views
how to stop a multiprocess in python
When trying to run multiprocessing on a for loop all the process are being executed but the program is not terminated and keep running.
How can i stop the program after all elements in the list got ...
0
votes
1
answer
27
views
Is iterator the best way to loop through PriorityQueue [duplicate]
I want to loop through a PriorityQueue, and wondering if following iterator() is the best way
Iterator<MyObject> itr = queue.iterator();
while(itr.hasNext()){
MyObject element = itr.next();
/...
0
votes
1
answer
28
views
Is there any way to pass a process object between multiple processes in python?
I have two files in the same directory,
A module has a function that is continously running and has no way to stop or pause in between,
# script.py
def run():
i = 0
while True:
print('\...
0
votes
1
answer
36
views
Python Multiprocessing Controlled Bidirectional Queue
I was trying to look for a Bidirectional/Omnidirectional Queue to send jobs back and forth between processes.
the best solution I could come up with was to use two multiprocessing queues that are ...
0
votes
0
answers
22
views
Adding function to Queue
I am writing telegram bot with aiogram, and I am using some third-party APIs, my question is that I need to put users request to queue because API isn't asynchronous, but aiogram is. I have no idea ...
0
votes
0
answers
53
views
Python multiprocess queue can get() some objects but not others
In the code below when I call .get() in get_query_result I actually get an ImportError as described in the function comment. The actual result in do_query is a large dictionary. It might be in the 10s ...
0
votes
2
answers
37
views
realloc:invalid next size while trying to reallocate an array
I am trying to implement a queue which has variable size of array but am having problem that it is giving me realloc: invalid next size; the capacity initialized to 1 the it could only reach capacity=...
0
votes
0
answers
25
views
The best way to speed up the queue with many consumers in python
I am having one multiprocess.Queue serving a large amount of consumers with quick job that causes many of them are queuing up to get() task from the Queue.
I have tried to spread out the tasks into ...
0
votes
1
answer
44
views
std queue pop a moved std string in multithreading
I am currently implementing a string processor. I used to using single-thread, but it is kind of slow, so I would like to use multi-thread to boost it. Now it has some problems I could not solve on my ...
-2
votes
0
answers
30
views
Can someone help me with data structure?
What is the data structure for "Scrolling mobile phone's calls log to get a record of the first incoming call" and "Pressing back and next button in web browser to access previous and ...
1
vote
0
answers
157
views
C++ Queue::Pop function acts weird when compiled with -O1
I have been writing my own queue in c++.
The problem is that it has a function called Queue::Pop() which calls the destructor of the first item in the queue which is kept track of by an index called ...
2
votes
1
answer
45
views
Moving first element to the back in the queue
I implemented the queue on my own. Also did rotate method which has to move n elements from the beginning to the end of the queue. But I missed some points and can not figure out what should I do ...
-1
votes
0
answers
29
views
I deleted the hangfire cron job from processing and now it not processing other jobs anybody know the reason
Cron Jobs
I deleted the cron job from processing and now it not processing other jobs anybody know the reason. help needed