queue

.NET webservice - acknowledge quickly, but continue processing in background

℡╲_俬逩灬. 提交于 2019-12-04 11:21:38
I'm building a .NET web service that will be consumed by a vendor's application, and I'm not sure how to accomplish the following: The vendor will call my webserivce with some information, but wants an acknowledgement returned quickly, just stating that I received their info. They don't care what I do with it, and don't want acknowledgement that I've finished processing. The info that I was passed needs to do something behind the scenes and act on the information in a time-sensitive manner - i.e., take some actions within a few minutes. I'll be contacting a number of other web services, as

Distributing java threads over multiple servers?

 ̄綄美尐妖づ 提交于 2019-12-04 11:04:29
问题 I'm pretty new to java and really enjoying learning about it. I have made a program that is working well but takes a bit long when I add more data for it to process. I made it threaded and it really speeded it up alot, but now I'm thinking of trying to speed it up more(obviously more data it has to process the longer it takes). Just an fyi, my program does not share any data between threads,it gets one item of a list and does some math and uploads the result to a database. Ideally, a few work

How to obtain the results from a pool of threads in python?

血红的双手。 提交于 2019-12-04 10:21:13
问题 I have searched here about how to do threading in python, but by far i haven't been able to get the answer i need. I'm not very familiar with the Queue and Threading python classes and for that reason some of the answers present here makes no sense at all to me. I want to create a pool of threads which i can give different task and when all of them have ended get the result values and process them. So far i have tried to do this but i'm not able to get the results. The code i have written is:

How to get the queued job from job ID in Laravel?

耗尽温柔 提交于 2019-12-04 10:04:52
Is there any way to get the queued job from the job ID in Laravel? While adding the job to the queue, I store the job ID. Later at some point of time (there is a delay to process the job in the queue), I want to remove the job from the queue. If I can get the job on the queue using the job ID, I can use delete() method to remove it. I use this code for laravel 5.5 : use Illuminate\Contracts\Bus\Dispatcher; $job = ( new JOB_CLASS() )->onQueue('QUEUE_NAME')->delay('DELAY'); $id = app(Dispatcher::class)->dispatch($job); It is a queue so you can not select it, but if you are logging the data also

Swift: Choose queue for Bluetooth Central manager

一曲冷凌霜 提交于 2019-12-04 09:56:28
I'm working on the app that will connect with a smart device via BLE and communicate with it. The question is: In what queue is the best practice to handle bluetooth events? I've read a lot of tutorials and in all of them I found this: centralManager = CBCentralManager(delegate: self, queue: nil) They choose to handle bluetooth events in main queue ( queue: nil ), but I suppose that it's not good practice. Because it could be a lot of queries send to peripheral device from central and a lot of answers send from peripheral to central. I assume this might be the reason of the app working slowly

C++ UDP sockets packet queuing

◇◆丶佛笑我妖孽 提交于 2019-12-04 09:36:57
I am using the same UDP socket for sending and receiving data. I am wondering if packet queuing for DGRAM sockets is already present, or do we have to handle it separately. If the user code has to handle queueing, how is it done? Do we have separate threads to recvfrom for the socket and put the packet in the reciver_queue and to sendto from another sending_queue? An example code will be absolutely awesome. Thanks for your help. There is a packet queue. However when the packet queue is filled then UDP packets start getting discarded. When they are discarded they are lost forever so make sure

Node.js/Express and parallel queues

喜欢而已 提交于 2019-12-04 09:08:08
问题 We are building an infrastructure which features a Node.js server and Express. In the server, what is happening is as follow: The server accepts an incoming HTTP request from client. Server generates two files (this operation can be "relatively long", meaning also 0.1 seconds or so) Server uploads the generated files (~20-200 KB each) to an external CDN Server responds to client, and this includes the URI of the file on the CDN Currently the server is doing this sequentially for each request,

built-in max heap API in Python

你说的曾经没有我的故事 提交于 2019-12-04 08:55:17
问题 Default heapq is min queue implementation and wondering if there is an option for max queue? Thanks. I tried the solution using _heapify_max for max heap, but how to handle dynamically push/pop element? It seems _heapify_max could only be used during initialization time. import heapq def heapsort(iterable): h = [] for value in iterable: heapq.heappush(h, value) return [heapq.heappop(h) for i in range(len(h))] if __name__ == "__main__": print heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0]) Edit,

Work with two separate redis instances with sidekiq?

喜欢而已 提交于 2019-12-04 08:35:47
问题 Good afternoon, I have two separate, but related apps. They should both have their own background queues (read: separate Sidekiq & Redis processes) . However, I'd like to occasionally be able to push jobs onto app2 's queue from app1 . From a simple queue/push perspective, it would be easy to do this if app1 did not have an existing Sidekiq/Redis stack: # In a process, far far away # Configure client Sidekiq.configure_client do |config| config.redis = { :url => 'redis://redis.example.com:7372

Why implement Queues as Circular Array?

南笙酒味 提交于 2019-12-04 08:34:02
问题 When implementing a FIFO like Queues, my instructor always advise us to represent it as a circular array and not in a regular array. Why? Is it because in the latter, we would end up having garbage data in the array? 回答1: If your are using a fixed number of Array-Slots/Elements, it is easier to recycle your slots in a circular arrangement, because you do not need to reorder your Elements. Whenever the first Element gets removed in an Array-Like arrangement, you must move your remaining