queue

Sidekiq-like queue using java tools?

こ雲淡風輕ζ 提交于 2019-12-11 17:39:13
问题 I want to have a work queue that behaves almost exactly like ruby's sidekiq(it doesn't need to use Redis, but it can - I just can't use ruby - not even Jruby). Basically I want to be able to create jobs that runs with some parameters and a worker pool executes the jobs. The workers are going to use hibernate to do some work, so I think that Spring integration could make things easier. 回答1: Spring Integration has Redis Queue inbound and outbound channel adapters. The inbound message-driven

Building a high performance and automatically backupped queue

时间秒杀一切 提交于 2019-12-11 17:12:47
问题 Please give me some hints on my issue. I'm building a queue data structure that: has a backup on hard disk at realtime and can restore the backup Can respond to massive enqueue/dequeue request Thank you! 回答1: Is this an exercise your doing. If not, you should probably look at some of the production message queueing technologies (e.g. MSMQ for Windows) which supports persisting the queues on the disk and not just storing them in memory. In terms of your requirements 1. has a backup on hard

Spring TaskExecutor unbounded queue

怎甘沉沦 提交于 2019-12-11 15:55:51
问题 I implemented the Spring-TaskExecutor (which is the equivalent of the JDK 1.5's Executor.) to process notifications notifications receiving from external systems. Interface with only one method: public interface AsynchronousService { void executeAsynchronously(Runnable task); } and the corresponding implementation: public class AsynchronousServiceImpl implements AsynchronousService { private TaskExecutor taskExecutor; @Override public void executeAsynchronously(Runnable task) { taskExecutor

Multiprocessing Running Slower than a Single Process

半腔热情 提交于 2019-12-11 15:19:31
问题 I'm attempting to use multiprocessing to run many simulations across multiple processes; however, the code I have written only uses 1 of the processes as far as I can tell. Updated I've gotten all the processes to work (I think) thanks to @PaulBecotte ; however, the multiprocessing seems to run significantly slower than its non-multiprocessing counterpart. For instance, not including the function and class declarations/implementations and imports, I have: def monty_hall_sim(num_trial, player

Laravel: Can I fail 'well' in an handle() of a Job?

霸气de小男生 提交于 2019-12-11 14:42:36
问题 I know that, if a job throw an Exception, the job fails, and will be retried automatically from queue worker in a few seconds. My question is: can i fail in a controlled way? I'd like to catch exceptions, create a more smal log, and, for example, return false to mark job as failed. Is there a way? Precisation: I DO NOT want to HANDLE failure. I want to provocate a failure without throwing exceptions. I some edge cases I need that jobs fails. But I also need to avoid to throw Exception to

Tkinter background while loop

安稳与你 提交于 2019-12-11 14:24:23
问题 Okay I have asked this in a very specific way : https://stackoverflow.com/questions/21667119/tkinter-increment-a-varaible-while-still-running-code But now to explain it in many less words. I have a program running using tkinter. When a button is pressed it puts a value into a queue. All I want is to be able to use a while loop to manipulate the data in the queue while the code still allows for more data to be added to the queue. So basically repeated : Check see if button pressed if yes : add

any way to run 2 loops at the same time?

被刻印的时光 ゝ 提交于 2019-12-11 14:19:31
问题 I want to create a c++ program for a bank queue. Where every 3 minutes a new customer enters the queue. every customer needs 5 minutes for the service. The program print out the information after the first 30 minutes The time of arriving for each customer The time of leaving for each customer How many customers are in the line? Who is the current serving customer? I wrote the current code: #include <queue> #include <ctime> #include <time.h> #include <conio.h> #include <windows.h> #include

Queue or Lock in child multiprocess

a 夏天 提交于 2019-12-11 14:17:08
问题 I've been on this site a while and I've found so many helpful solutions to the problems I've encountered as I build my first python program. I'm hopeful you guys can help me once again. I am trying to launch a variable number of multiprocesses, with each one taking a small piece of a list to scan. I have been tinkering with queues, but when I implement them, they always add a sizable amount of time to my loop. I am looking to maximize my speed while protecting my Titles.txt from erroneous

Queue::later() not working on Laravel

我的梦境 提交于 2019-12-11 13:53:51
问题 I am studying Laravel framework and I am facing some problems with queues. Laravel provides a unified API to work with queues and I am taking a look into it. One of the methods that Laravel provides is Queue::later(DateTime|int $delay, string $job, mixed $data = '', string $queue = null); So, I implemented my job class: <?php class SendEmail { public function send($job, $data) { Log::info('JOB: ' . $job->getName()); Log::info('DATA: ' . $data['message']); } } Above, I log on a file, the

c# button click queueing

断了今生、忘了曾经 提交于 2019-12-11 13:25:28
问题 I have a button click event handler with a switch case in it that controls multiple buttons in one event handler. I need to use a queue because while one button is clicked and doing some processing, second button click won't interfere with the first button click, but added to the queue. I don't want to use .enabled=false; because it'll discard the second click completely, and I'm currently editing someone's software at work so I don't want to break things that I don't know, so what are you