task-queue

Background processes in Node.js

混江龙づ霸主 提交于 2019-12-18 09:58:08
问题 What is a good aproach to handle background processes in a NodeJS application? Scenario : After a user posts something to an app I want to crunch the data, request additional data from external resources, etc. All of this is quite time consuming, so I want it out of the req/res loop. Ideal would be to just have a queue of jobs where you can quickly dump a job on and a daemon or task runner will always take the oldest one and process it. In RoR I would have done it with something like Delayed

how to use q.js promises to work with multiple asynchronous operations

有些话、适合烂在心里 提交于 2019-12-17 22:07:21
问题 Note: This question is also cross-posted in Q.js mailing list over here. i had a situation with multiple asynchronous operations and the answer I accepted pointed out that using Promises using a library such as q.js would be more beneficial. I am convinced to refactor my code to use Promises but because the code is pretty long, i have trimmed the irrelevant portions and exported the crucial parts into a separate repo. The repo is here and the most important file is this. The requirement is

Datastore and task queue downtime correlation

為{幸葍}努か 提交于 2019-12-14 02:28:18
问题 What correlation is there between datastore and task queue downtime? (I'd like to use the task queue to defer some operations in the case of datastore downtime.) 回答1: The Task Queue should be generally more durable than the datastore, as it's a simpler system, but there's no guarantee that they can't both experience a simultaneous outage. 来源: https://stackoverflow.com/questions/3800252/datastore-and-task-queue-downtime-correlation

How to deal with eventual consistency in fork-join-queue

穿精又带淫゛_ 提交于 2019-12-13 14:09:12
问题 I'm currently looking to replace a flawed implementation of the fork-join-queue described in the following video: https://youtu.be/zSDC_TU7rtc?t=33m37s I realize that this video is nearly eight years old now, and I would be very happy to learn of any potential new and better ways to do such things, but for now I'm focusing on trying to make this work as described by Brett. As of right now, what's in front of me is a bit of a mess. One of the things the original developer did differently from

Status Code 503, Requested service is not available yet

橙三吉。 提交于 2019-12-13 06:15:37
问题 I am using spring mvc(annotations). I have written backends. When tasks start running, retry count goes on increasing, It shows status code '503' and message 'service unavailable'. When I hit backend url into browser, I got the same error after hitting many times then getting correct response. Is there any solution for this..? 来源: https://stackoverflow.com/questions/22009892/status-code-503-requested-service-is-not-available-yet

How to call one servlet to another servlet in GWT Using Java

戏子无情 提交于 2019-12-13 06:00:32
问题 1) Hi I am new gwt. I want to execute one servlet to another servlet. for example i want to execute servlet2 from servlet1 one. I can execute sevlet1 using RPC call so from servlet1 i want to execute servlet2 which have doPost method i want to execute. 2) I want to use task queue on GAE. so can understood the task queue by reading https://cloud.google.com/appengine/docs/java/taskqueue/overview-push. In this document Enqueue is servlet which create task and worker is another servlet which

google app engine task queue sample

陌路散爱 提交于 2019-12-13 00:34:27
问题 Currently, i try to working with task queue. But i don't see any complete sample on this matter. So please give me some sample of task queue in google app engine, written in python. 回答1: import: from google.appengine.api import taskqueue define and run: taskqueue.add(url='/service', params={'user': user}, method="GET") url is the RequestHandler that leads to the code to run in the queue params can be regular url params 回答2: The example in Google's documentation is simple but complete. http:/

Memory usage differs greatly (and strangely) between frontend and backend

南笙酒味 提交于 2019-12-12 20:28:16
问题 My App Engine-application is having problem with memory leakage. I log memory usage along the way to find the issue. from google.appengine.api.runtime import memory_usage memory_usage().current() The function that exceeded "soft private memory limit of 128 MB" is within a deferred task. It should behave the same each time. I re-run it from the consoles task-queue (backend) and from the frontend via get-request. Both get the exception after the 6th log. The result differs is a way I can't wrap

App Engine Python UrlFetch.set_default_fetch_deadline

半世苍凉 提交于 2019-12-12 18:14:01
问题 I have looked through the docs here: https://cloud.google.com/appengine/docs/python/urlfetch/ and here: https://cloud.google.com/appengine/articles/deadlineexceedederrors?hl=en I also found this stack overflow question which relates to my question: How to set timeout for urlfetch in Google App Engine? I am connecting from my app engine app to an outside web service, that I do not have control over. Sometimes the requests take longer than 60 seconds. I set my application up to use the deferred

How can tasks be prioritized when using the task queue on google app engine?

青春壹個敷衍的年華 提交于 2019-12-12 15:03:36
问题 I'm trying to solve the following problem: I have a series of "tasks" which I would like to execute I have a fixed number of workers to execute these workers (since they call an external API using urlfetch and the number of parallel calls to this API is limited) I would like for these "tasks" to be executed "as soon as possible" (ie. minimum latency) These tasks are parts of larger tasks and can be categorized based on the size of the original task (ie. a small original task might generate 1