queue

What's a good strategy for processing a queue in parallel?

老子叫甜甜 提交于 2021-02-19 05:17:10
问题 I'm writing a program which needs to recursively search through a folder structure, and would like to do so in parallel with several threads. I've written the rather trivial synchronous method already - adding the root directory to the queue initially, then dequeuing a directory, queuing its subdirectories, etc., until the queue is empty. I'll use a ConcurrentQueue<T> for my queue, but have already realized that my loops will stop prematurely. The first thread will dequeue the root directory,

What's a good strategy for processing a queue in parallel?

99封情书 提交于 2021-02-19 05:16:06
问题 I'm writing a program which needs to recursively search through a folder structure, and would like to do so in parallel with several threads. I've written the rather trivial synchronous method already - adding the root directory to the queue initially, then dequeuing a directory, queuing its subdirectories, etc., until the queue is empty. I'll use a ConcurrentQueue<T> for my queue, but have already realized that my loops will stop prematurely. The first thread will dequeue the root directory,

What's a good strategy for processing a queue in parallel?

霸气de小男生 提交于 2021-02-19 05:15:44
问题 I'm writing a program which needs to recursively search through a folder structure, and would like to do so in parallel with several threads. I've written the rather trivial synchronous method already - adding the root directory to the queue initially, then dequeuing a directory, queuing its subdirectories, etc., until the queue is empty. I'll use a ConcurrentQueue<T> for my queue, but have already realized that my loops will stop prematurely. The first thread will dequeue the root directory,

Laravel worker not attempting the job but rather deleting it

江枫思渺然 提交于 2021-02-19 04:31:26
问题 laravel 5.4 php 7.1.32 supervisor 3.3.1 (I know... I know. The company is running 3 years behind) config/queue.php 'database' => [ 'driver' => 'database', 'connection' => 'queue', // means in config/database.php I have to setup a new connection 'table' => 'jobs', 'queue' => 'default', 'retry_after' => 90, ], supervisor configurations [program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/html/project/artisan queue:work autostart=true autorestart=true

Laravel worker not attempting the job but rather deleting it

岁酱吖の 提交于 2021-02-19 04:31:10
问题 laravel 5.4 php 7.1.32 supervisor 3.3.1 (I know... I know. The company is running 3 years behind) config/queue.php 'database' => [ 'driver' => 'database', 'connection' => 'queue', // means in config/database.php I have to setup a new connection 'table' => 'jobs', 'queue' => 'default', 'retry_after' => 90, ], supervisor configurations [program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/html/project/artisan queue:work autostart=true autorestart=true

Laravel queue push listener - queue monitoring

五迷三道 提交于 2021-02-19 04:18:10
问题 I am using the JobProcessing , JobProcessed and JobFailed to populate a queue logs table. I would like to also listen for an event as jobs are pushed to the queue. Does this exist? I see from running: \Redis::lrange('queues:mws', 0, -1) That a pushedAt parameter exists, but I am unsure how to get this in an event prior to the job actually being processed. This is fundamentally in order to check that my queues are all: a) actually running (the workers have not stopped). b) the job processing

Laravel queue push listener - queue monitoring

点点圈 提交于 2021-02-19 04:17:59
问题 I am using the JobProcessing , JobProcessed and JobFailed to populate a queue logs table. I would like to also listen for an event as jobs are pushed to the queue. Does this exist? I see from running: \Redis::lrange('queues:mws', 0, -1) That a pushedAt parameter exists, but I am unsure how to get this in an event prior to the job actually being processed. This is fundamentally in order to check that my queues are all: a) actually running (the workers have not stopped). b) the job processing

Laravel queue push listener - queue monitoring

[亡魂溺海] 提交于 2021-02-19 04:17:01
问题 I am using the JobProcessing , JobProcessed and JobFailed to populate a queue logs table. I would like to also listen for an event as jobs are pushed to the queue. Does this exist? I see from running: \Redis::lrange('queues:mws', 0, -1) That a pushedAt parameter exists, but I am unsure how to get this in an event prior to the job actually being processed. This is fundamentally in order to check that my queues are all: a) actually running (the workers have not stopped). b) the job processing

Laravel queue push listener - queue monitoring

假如想象 提交于 2021-02-19 04:16:13
问题 I am using the JobProcessing , JobProcessed and JobFailed to populate a queue logs table. I would like to also listen for an event as jobs are pushed to the queue. Does this exist? I see from running: \Redis::lrange('queues:mws', 0, -1) That a pushedAt parameter exists, but I am unsure how to get this in an event prior to the job actually being processed. This is fundamentally in order to check that my queues are all: a) actually running (the workers have not stopped). b) the job processing

Laravel queue push listener - queue monitoring

你说的曾经没有我的故事 提交于 2021-02-19 04:16:08
问题 I am using the JobProcessing , JobProcessed and JobFailed to populate a queue logs table. I would like to also listen for an event as jobs are pushed to the queue. Does this exist? I see from running: \Redis::lrange('queues:mws', 0, -1) That a pushedAt parameter exists, but I am unsure how to get this in an event prior to the job actually being processed. This is fundamentally in order to check that my queues are all: a) actually running (the workers have not stopped). b) the job processing