queue

How to use Models in a Laravel Queue

☆樱花仙子☆ 提交于 2019-12-07 13:02:34
问题 I'm trying to import a mailing list from CSV to my DATABASE. I have two models in my Laravel which is responsible for doing this: Target and Mailing (one Target has many Mailing s) I'm using Queue system with Beanstalkd. I'm using: Queue::push('ImportCSV', array( 'file' => $file->getClientOriginalName(), 'target' => $name )); To push my jobs and then I have the ImportCSV job class: class ImportCSV { public function fire($job, $data) { Log::info("Starting to add {$data['target']} to database")

std::queue memory consumption leads to memory leak - C++ ?

橙三吉。 提交于 2019-12-07 10:40:51
问题 The following codes didn't release the memory consumed for 3000 elements even after i pops out all the elements from the qInt queue. What is the reason ? std::queue<int> qInt; //Step01: Check the running memory for (int i=0;i<3000;i++) { qInt.push(i); } //Step02: Check the running memory it should have been increased while(!qInt.empty()) { qInt.pop(); } //Step03: Check the running memory expecting Step01 memory but it is still the same of Step02 回答1: By defalut std containers do not

Get “next” row from SQL Server database and flag it in single transaction

纵饮孤独 提交于 2019-12-07 08:33:59
问题 I have a SQL Server table that I'm using as a queue, and it's being processed by a multi-threaded (and soon to be multi-server) application. I'd like a way for a process to claim the next row from the queue, flagging it as "in-process", without the possibility that multiple threads (or multiple servers) will claim the same row at the same time. Is there a way to update a flag in a row and retrieve that row at the same time? I want something like this psuedocode, but ideally, without blocking

REST: Add message to azure storage queue without base64 encoding?

非 Y 不嫁゛ 提交于 2019-12-07 07:57:07
问题 I don't have the possibility to encode my request to base64, and according to the documentation I shouldn't have to, but I can't figure it out. If I Base64 encode it's working fine: <QueueMessage> <MessageText>PHNhbXBsZT5zYW1wbGUgbWVzc2FnZTwvc2FtcGxlPg==</MessageText> </QueueMessage> Which adds the decoded message to the queue: <sample>sample message</sample> According to the documentation (https://msdn.microsoft.com/sv-se/library/azure/dd179346.aspx) A message must be in a format that can be

GCD obtaining queue name/label

こ雲淡風輕ζ 提交于 2019-12-07 06:53:40
问题 How can I get the current queue name? I mean queue label like com.example.myqueue . In the Xcode 4 debugger I can see just _block_invoke_1 . 回答1: How about dispatch_queue_get_label? 回答2: In Objective-C you can log the label of the current queue with: NSLog(@"%s", dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)); In Swift (2.0): print(String(UTF8String: dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL))!) 来源: https://stackoverflow.com/questions/5166711/gcd-obtaining-queue-name

How do I get the nth item in a Queue?

假如想象 提交于 2019-12-07 05:53:35
问题 I have a number of queues and priority queues in my application. I would like to easily access the nth items in these queues, but don't see an easy way to do that using the API. I guess I could create an Iterator and iterate to the nth element or use toArray()[index] , but it seems like there should be an easier way. Am I missing something? 回答1: Am I missing something? Yes - the fact that accessing elements by index is not part of the concept of a queue. If you need to access elements by

Design: Queue Management question (C#)

[亡魂溺海] 提交于 2019-12-07 05:22:17
问题 I want to build a windows service that will use a remote encoding service (like encoding.com, zencoder, etc.) to upload video files for encoding, download them after the encoding process is complete, and process them. In order to do that, I was thinking about having different queues, one for handling currently waiting files, one for files being uploaded, one for files waiting for encoding to complete and one more for downloading them. Each queue has a limitation, for example only 5 files can

How to clear NiFi queues?

吃可爱长大的小学妹 提交于 2019-12-07 05:09:53
问题 We are creating some flows in NiFi and there might be some cases where the queues are being build up but due to some reason the flow doesn't work as expected. At the end of the day, i would like to clear the queues and somehow would like to automate it. The question is how can we delete the queues from backend? Is there any way we can achieve that? 回答1: In addition to the explicit "Drop Queue" function Bryan mentioned, a couple other features you may be interested are the "Back Pressure" and

How to make a queue persisted in HornetQ 2.2.5 core client?

人盡茶涼 提交于 2019-12-07 04:56:01
问题 I want to make persisted queue in core hornetQ client. The problem is when I stop the server the queue and the data will be destroyed. How to make a queue persisted? My code is: import java.util.Date; import org.hornetq.api.core.TransportConfiguration; import org.hornetq.api.core.client.ClientConsumer; import org.hornetq.api.core.client.ClientMessage; import org.hornetq.api.core.client.ClientProducer; import org.hornetq.api.core.client.ClientSession; import org.hornetq.api.core.client

How to dispatch a Job to a specific queue in Lumen 5.5

孤人 提交于 2019-12-07 03:55:45
问题 In standard a job I use this method to dispatch a Job: dispatch(new PurchaseJob($trxId, $method, $params)); Next I want to dispatch another Job to send email, but I want to split it to another separate queue. From what I read on Laravel 5.5 docs I could do this: SendEmailJob::dispatch($userEmail)->onQueue('send_email'); But it does not seems to work on Lumen 5.5. What could I do to make this work or is there any other method that are not stated in the docs? 回答1: I just managed to find a way