queue

Maximum number of messages sent to a Queue in OpenMQ?

徘徊边缘 提交于 2020-01-03 03:22:17
问题 I am currently using Glassfish v2.1 and I have set up a queue to send and receive messages from with Sesion beans and MDBs respectively. However, I have noticed that I can send only a maximum of 1000 messages to the queue. Is there any reason why I cannot send more than 1000 messages to the queue? I do have a "developer" profile setup for the glassfish domain. Could that be the reason? Or is there some resource configuration setting that I need to modify? I have setup the sun-resources.xml

“EOF error” at program exit using multiprocessing Queue and Thread

强颜欢笑 提交于 2020-01-02 13:31:51
问题 I have trouble understanding why this simple program raises an EOFError at the end. I am using a Queue() to communicate with a Thread() that I want to automatically and cleanly terminate atexit of my program. import threading import multiprocessing import atexit class MyClass: def __init__(self): self.queue = None self.thread = None def start(self): self.queue = multiprocessing.Queue() self.thread = threading.Thread(target=self.queued_writer, daemon=True) self.thread.start() # Remove this: no

Special queue with defined size

佐手、 提交于 2020-01-02 08:50:49
问题 I need a collection that is limited in its size. It has to be similar to a circular buffer. I think that the fastest way to describe it would be by making an example. Suppose I have an instance of this "special" queue, of size 4. This is the queue initially: 6 3 9 2 If I push something into it, it has to add it at the beginning, remove the last element and return its value, so, if I add 3 it would become: 3 6 3 9 and returns 2 I hope I've been clear... A general implementation is sufficient,

How to convert 'from Queue import Queue, Empty' from Python 2 to Python 3? [duplicate]

瘦欲@ 提交于 2020-01-02 08:21:25
问题 This question already has an answer here : No module named 'Queue' (1 answer) Closed 2 years ago . I'm converting a source code written in Python 2 to Python 3 and I stumbled into this: from Queue import Queue, Empty I changed it to: from multiprocessing import Queue, Empty But this gives me an exception: ImportError: cannot import name 'Empty' How do I fix this? 回答1: multiprocessing.Queue is used for processes, don't let the capitalization confuse you. Queue, which was renamed to queue in

How to queue Laravel 5.7 “email verification” email sending

无人久伴 提交于 2020-01-02 08:14:14
问题 Laravel 5.7 included "email verification" feature works well but not async email sending (during user register or resend link page) is not ideal. Is there any way to send the email verification email through a queue without rewrite whole email verification in Laravel 5.7 ? 回答1: Yes! It's possible. And to do that you will have to rewrite the sendEmailVerificationNotification in your App\User . This method is provide by the Illuminate\Auth\MustVerfiyEmail trait. The method

Implement A Queue using Two Stacks Python

别来无恙 提交于 2020-01-02 07:40:21
问题 I've been going over some of the many coding interview questions. I was wondering how you would go about implementing a queue using two stacks in Python? Python is not my strongest language so I need all the help I can get. Like the enqueue, dequeue, and front functions. 回答1: class Queue(object): def __init__(self): self.instack=[] self.outstack=[] def enqueue(self,element): self.instack.append(element) def dequeue(self): if not self.outstack: while self.instack: self.outstack.append(self

find a pair in a STL list where only first element is known

十年热恋 提交于 2020-01-02 07:05:14
问题 assumend I have a (filled) list std::list<std::pair<int,otherobject>> myList; and want to find() the first element within this list, where int has a specific value - how can I do that? To explain it a bit further: I want to append these pairs to the list with an int that identifies otherobject but is not unique. The order where these int/otherobject pairs arrive has to be kept. When an int is found during access to elements of this list the first occurence of that int has to be given back

Should I Use A Queueing System To Handle Payments?

拟墨画扇 提交于 2020-01-02 05:31:07
问题 I'm using Slim in conjunction with Stripe's PHP Library to process payments in my application. All is well, however up until recently, I have discovered an alarming fault in my system that I believe may be a much larger issue than I probably think. In my logic, at three separate checkpoints of the payment process I inspect the inventory in my (MySQL) database to ensure a user isn't purchasing more products than is available. However, when multiple users make a request within approximately

Azure - queueing time based tasks

柔情痞子 提交于 2020-01-02 04:58:12
问题 My application that runs on Windows Azure processes incoming requests from a user (which are put into an Azure Queue) and assigns them to real-world people. The people have a certain amount of time to handle the request. If none of the people assigned handle the request, I need to move on to a new set of people. Basically, I want to queue these tasks to be handled at a certain time, and then handle them again. If one of the users handles the task, I need to dequeue it so it isn't handled

Is it possible to remove queue element by value?

爷,独闯天下 提交于 2020-01-02 03:17:26
问题 I want to remove element from queue with specific value. How to do such thing? (I am trying to create a concurrent mixture of map and queue and currently I try to implement on this answer) So I currently have such code: #ifndef CONCURRENT_QUEUED_MAP_H #define CONCURRENT_QUEUED_MAP_H #include <map> #include <deque> #include <boost/thread.hpp> #include <boost/thread/locks.hpp> template <class map_t_1, class map_t_2> class concurrent_queued_map { private: std::map<map_t_1, map_t_2> _ds; std: