queue

Supervisorctl does not auto-restart daemon queue worker when hanging

旧时模样 提交于 2019-12-08 07:33:27
问题 I have supervisorctl managing some daemon queue workers with this configuration : [program:jobdownloader] process_name=%(program_name)s_%(process_num)03d command=php /var/www/microservices/ppsatoms/artisan queue:work ppsjobdownloader --daemon --sleep=0 autostart=true autorestart=true user=root numprocs=50 redirect_stderr=true stdout_logfile=/mnt/@@sync/jobdownloader.log Sometimes some workers are like hanging (running but stop getting queue messages) and supervisorctl does not automatically

Method to “remember” past entries

爷,独闯天下 提交于 2019-12-08 07:24:29
问题 Part of an application I'm building in VB has terminal functionality, and I'd like to add functionality to it so it remembers past commands in chronological order, similarly to how a windosw terminal works. In short I'd like you to be able to press the up arrow when the text area is focused and be able to cycle through a list of commands that were entered previously. I had two ideas for how to do this: A combobox that, when you hit enter, reads whatever is in combobox.text, whether that be a

Laravel queue get curl error when job dispatching

牧云@^-^@ 提交于 2019-12-08 06:17:16
问题 I'm using bitmex library to build some trading bot. When i try to make request like this (from test controller): $this->api->createOrder(....); Everything works fine - api creates an order. But, when i try to make this request with queue job(database driver) i got error: curl_setopt() expects parameter 1 to be resource, integer given Any api request from queue cUrl instance return 0 instead resource and this error. What could be the problem? P.S. Curl method from library: private function

Call function multiple times in the same moment but execute different calls with delay in nodejs

半世苍凉 提交于 2019-12-08 04:02:11
问题 I need to call a function multiple times from different contexts, but i need that each call fires not before that one second has passed after the previous call started. i'll make an example: var i = 0; while(i<50) { do_something(i) i++ } function do_something(a) { console.log(a) } I want that this log: '1', then after a second '2', then after a second '3', then after a second '4'... I can't use simple setInterval or setTimeout because this function 'do_something(param)' can be called in the

Consumer doesn't work in my simple producer/consumer/queue code in Java

时间秒杀一切 提交于 2019-12-08 03:58:05
问题 I am trying to implement a simple producer/consumer system in Java 11. Basically, I take two threads for each, plus a global queue, simply as follows: A global priority queue. The first thread, producer, runs a HTTP server, listens to incoming http messages, and upon receiving a message, pushes it as a job to the queue ( queue.size increments) The second thread, the consumer, continously peeks the queue. If there is a job ( job ! = null ), submits a HTTP request somewhere and upon successful

python multi-processing queue: is putting independent from getting?

蹲街弑〆低调 提交于 2019-12-08 03:25:52
问题 Is putting an object in a multi-processing queue independent from getting an object from it? In other words, will putting an object block the process P1 if another process P2 is getting from it? Update: I am assuming an infinite queue. 回答1: My reading of the source code is that get obtains a read lock, which is independent of of the lock (called _notempty ) acquired by put . If I understand correctly, concurrent get s can block each other, and concurrent put s can block each other (modulo

Queue ordering

倾然丶 夕夏残阳落幕 提交于 2019-12-08 03:23:56
问题 I have an array of items, sorted so that the oldest item is first in the array. I want to load a queue from the array, such that when I pop the items on the queue the oldest item comes first. How can I do this? 回答1: Use LINQ to Objects... var q = new Queue<T>(array.OrderBy(d => d.date)); EDIT: Ops, wrong way around. 回答2: You want a priority queue. Then it doesn't matter whether your incoming items are sorted or not. Maybe there is an implementation in the library. PS: the priority in your

Sync device data with web-server

大憨熊 提交于 2019-12-08 02:48:09
问题 I have data in my application which must be updated on the server on the basis of network availability. I store this data on a local database on android using sqlite. Currently the idea is: Data should be inserted on the local sqlite database A service should be waiting as soon as the data is inserted it checks the network availability and send it to the server and wait for success response. If the response true is received from the server it should update the sync status of that sqlite row

Gstreamer rtsp playing (with sound)

随声附和 提交于 2019-12-08 02:23:24
问题 im newbie in gstreamer and simple try to wath rtsp video flow from Dlink 2103 camera. When i trying it (just video): gst-launch rtspsrc location=rtsp://192.168.0.20/live1.sdp ! \ rtph264depay ! \ h264parse ! capsfilter caps="video/x-h264,width=1280,height=800,framerate=(fraction)25/1" ! ffdec_h264 ! ffmpegcolorspace ! autovideosink Its ok. When i trying it (just audio): gst-launch rtspsrc location=rtsp://192.168.0.20/live1.sdp ! \ rtpg726depay ! ffdec_g726 ! audioconvert ! audioresample !

How to sequentially run an animation * only once * after animation on a group (e.g. siblings)

那年仲夏 提交于 2019-12-08 01:20:34
问题 Here's my dilemma. I have 2 animations that need to run sequentially. The first animation runs on a group of elements acquired through jQuery's siblings() function. The second animation runs on a single element. (The one upon which siblings() was called.) This needs to take place after the first animation has finished. If I don't use queue() or a callback after the first animation, they run simultaneously. If I do use queue() or a callback after the first, then the second animation ends up