kue

How to make the client download a very large file that is genereted on the fly

无人久伴 提交于 2019-12-04 13:43:56
问题 I have an export function that read the entire database and create a .xls file with all the records. Then the file is sent to the client. Of course, the time of export the full database requires a lot of time and the request will soon end in a timeout error. What is the best solution to handle this case? I heard something about making a queue with Redis for example but this will require two requests: one for starting the job that will generate the file and the second to download the generated

How can I run redis on a single server on different ports?

喜欢而已 提交于 2019-12-03 16:19:12
I'm using kue which uses node_redis , but I'm also already using node_redis for my sessions, so I'd like to have kue create a server on a specific port say the default 6379 and then kue listen on port 1234 . How would I be able to do this? I found this article which talks about something similar, but I don't really want to have to create an init script to do this. Launch redis-server and supply a different argument for 'port' which can be done on the command-line: edd@max:~$ redis-server -h Usage: ./redis-server [/path/to/redis.conf] [options] ./redis-server - (read config from stdin) ./redis

How to make the client download a very large file that is genereted on the fly

守給你的承諾、 提交于 2019-12-03 08:26:59
I have an export function that read the entire database and create a .xls file with all the records. Then the file is sent to the client. Of course, the time of export the full database requires a lot of time and the request will soon end in a timeout error. What is the best solution to handle this case? I heard something about making a queue with Redis for example but this will require two requests: one for starting the job that will generate the file and the second to download the generated file. Is this possible with a single request from the client? Excel Export: Use Streams . Following is

How to schedule a job once every Thursday using Kue?

↘锁芯ラ 提交于 2019-12-03 03:11:56
Using Kue , how do I schedule a job to be executed once every Thursday? The Kue readme mentions that I can delay a Job, but what about repeatedly executing the Job at a specific time? I can do what I want with a cron job, but I like Kue's features. What I want is to process a Job once anytime on Thursday, but only once. I had a similar question and I basically came up with the following. If anyone else has a different solution I would love to see some other ideas. var jobQueue = kue.createQueue(); // Define job processor jobQueue.process('thursday-jobs', function (job, done) { var

How to communicate Web and Worker dynos with Node.js on Heroku?

流过昼夜 提交于 2019-11-29 20:17:46
Web Dynos can handle HTTP Requests and while Web Dynos handles them Worker Dynos can handle jobs from it. But I don't know how to make Web Dynos and Worker Dynos to communicate each other. For example, I want to receive a HTTP request by Web Dynos , send it to Worker Dynos , process the job and send back result to Web Dynos , show results on Web. Is this possible in Node.js? (With RabbitMQ or Kue or etc)? I could not find an example in Heroku Documentation Or Should I implement all codes in Web Dynos and scaling Web Dynos only? As the high-level article on background jobs and queuing suggests,

Node.js Kue how to restart failed jobs

若如初见. 提交于 2019-11-29 07:07:50
问题 I am using kue for delayed jobs in my node.js application. I have some problems to figure out how I can restart a job using the API of kue without having to move the id of a job manually from the the list of failed jobs to the list of inactive jobs using redis commands. Is this possible using kue? I don't want to set a fixed number of retry attempts - I just want to retry specific jobs. Suggestions for a well maintained alternative to kue are also welcome. 回答1: i dont know if this is working

How to communicate Web and Worker dynos with Node.js on Heroku?

我是研究僧i 提交于 2019-11-28 16:49:34
问题 Web Dynos can handle HTTP Requests and while Web Dynos handles them Worker Dynos can handle jobs from it. But I don't know how to make Web Dynos and Worker Dynos to communicate each other. For example, I want to receive a HTTP request by Web Dynos , send it to Worker Dynos , process the job and send back result to Web Dynos , show results on Web. Is this possible in Node.js? (With RabbitMQ or Kue or etc)? I could not find an example in Heroku Documentation Or Should I implement all codes in