queue

Running multiple Laravel queue workers using Supervisor

和自甴很熟 提交于 2020-01-10 19:45:10
问题 I using Laravel queues using a database driver and supervisor to keep a queue worker running all the time: [program:laravel_queue] command=php artisan queue:listen --timeout=1800 --tries=5 directory=/var/app/current stdout_logfile=/var/app/support/logs/laravel-queue.log logfile_maxbytes=0 logfile_backups=0 redirect_stderr=true autostart=true autorestart=true startretries=86400 EOB Some of the queue tasks can take around 10 minutes to complete. I have 2 parts to the question: 1) How can i edit

Running multiple Laravel queue workers using Supervisor

倖福魔咒の 提交于 2020-01-10 19:44:49
问题 I using Laravel queues using a database driver and supervisor to keep a queue worker running all the time: [program:laravel_queue] command=php artisan queue:listen --timeout=1800 --tries=5 directory=/var/app/current stdout_logfile=/var/app/support/logs/laravel-queue.log logfile_maxbytes=0 logfile_backups=0 redirect_stderr=true autostart=true autorestart=true startretries=86400 EOB Some of the queue tasks can take around 10 minutes to complete. I have 2 parts to the question: 1) How can i edit

Add timeout argument to python's Queue.join()

强颜欢笑 提交于 2020-01-10 08:24:46
问题 I want to be able to join() the Queue class but timeouting after some time if the call hasn't returned yet. What is the best way to do it? Is it possible to do it by subclassing queue\using metaclass? 回答1: Subclassing Queue is probably the best way. Something like this should work (untested): def join_with_timeout(self, timeout): self.all_tasks_done.acquire() try: endtime = time() + timeout while self.unfinished_tasks: remaining = endtime - time() if remaining <= 0.0: raise NotFinished self

Concurrent and Blocking Queue in Java

拥有回忆 提交于 2020-01-09 12:18:28
问题 I have the classic problem of a thread pushing events to the incoming queue of a second thread. Only this time, I am very interested about performance. What I want to achieve is: I want concurrent access to the queue, the producer pushing, the receiver poping. When the queue is empty, I want the consumer to block to the queue, waiting for the producer. My first idea was to use a LinkedBlockingQueue , but I soon realized that it is not concurrent and the performance suffered. On the other hand

Queue using several processes to launch bash jobs

微笑、不失礼 提交于 2020-01-07 07:59:07
问题 I need to run many (hundreds) commands in shell, but I only want to have a maximum of 4 processes running (from the queue) at once. Each process will last several hours. When a process finishes I want the next command to be "popped" from the queue and executed. I also want to be able to add more process after the beginning, and it will be great if I could remove some jobs from the queue, or at least empty the queue. I have seen solutions using makefile, but this only work if I have all my

StackOverFlowError in Java postfix calculator

喜你入骨 提交于 2020-01-07 07:51:09
问题 The following class is used by another program. When it is accessed, it throws a StackOverFlowError. This is part of a Postfix Calculator I have to do as a project at my university. Any help would be greatly appreciated, thank you in advance. I'm quite new at Java and I have no idea what to do. CODE: import java.util.Queue; import java.util.Stack; public class MyPostfixMachine implements PostfixMachineInterface { MyMathOperations mmo = new MyMathOperations(); MyPostfixMachine mpm = new

StackOverFlowError in Java postfix calculator

浪子不回头ぞ 提交于 2020-01-07 07:51:08
问题 The following class is used by another program. When it is accessed, it throws a StackOverFlowError. This is part of a Postfix Calculator I have to do as a project at my university. Any help would be greatly appreciated, thank you in advance. I'm quite new at Java and I have no idea what to do. CODE: import java.util.Queue; import java.util.Stack; public class MyPostfixMachine implements PostfixMachineInterface { MyMathOperations mmo = new MyMathOperations(); MyPostfixMachine mpm = new

Laravel 4 Queue - [InvalidArgumentException] There are no commands defined in the “queue” namespace

99封情书 提交于 2020-01-07 03:39:47
问题 I'm using Laravel 4 + Beanstalk + Supervisor on a CentOS 6 VPS. It was already a pain to install both beanstalk and supervisor on the VPS, but I got through it (I have done this same installation on my local server, a Macbook Pro, and it's working fine there). I want to take advantage of Laravel 4's Queues and Beanstalk to send email asynchronously. I have made a "program" for supervisor that basically runs the command php artisan queue:listen --env=production but the process associated to

Asynchronous Callback in NSOperation inside of NSOperationQueue is never called

旧时模样 提交于 2020-01-06 19:32:05
问题 I need to chain together several NSOperation s that do network calls in one NSOperationQueue and then wait for all to be completed. I'm adding all of the NSOperation s to my NSOperationQueue and then call operationQueue.waitUntilAllOperationsAreFinished() . This works, but it waits indefinitely, as the callbacks in the NSOperations , that set the operation's state to 'finished', get never called. I'm using the following NSOperation subclass: class ConcurrentOperation: NSOperation { enum State

Asynchronous Callback in NSOperation inside of NSOperationQueue is never called

荒凉一梦 提交于 2020-01-06 19:30:47
问题 I need to chain together several NSOperation s that do network calls in one NSOperationQueue and then wait for all to be completed. I'm adding all of the NSOperation s to my NSOperationQueue and then call operationQueue.waitUntilAllOperationsAreFinished() . This works, but it waits indefinitely, as the callbacks in the NSOperations , that set the operation's state to 'finished', get never called. I'm using the following NSOperation subclass: class ConcurrentOperation: NSOperation { enum State