task-queue

Web Application Architecture - Job/Task Queue needed?

坚强是说给别人听的谎言 提交于 2019-12-04 02:58:23
I am currently designing a web application that will allow users to schedule tasks which will be executed against an HTTP API (on behalf of them). The tasks can be recurring and the minimal time resolution that can be used for scheduling will be one minute. Because of the nature of the tasks I think it makes sense to execute them asynchronously. However, how should the architecture of this part look like? I thought about using a task queue to create tasks by the web application and let them be executed by a worker. In this case, I have several questions: How do I handle recurring tasks? How do

Is there a way to know when a set of app engine task queue tasks have completed?

我只是一个虾纸丫 提交于 2019-12-03 17:15:54
is there a way to determine when a set of Google App Engine tasks (and child tasks they spawn) have all completed? Let's say that I have 100 tasks to execute and 10 of those spawn 10 child tasks each. That's 200 tasks. Let's also say that those child tasks might spawn more tasks, recursively, etc... Is there a way to determine when all tasks have completed? I tried using the app engine pipeline API, but it doesn't look like it's going to work out for my particular use case, even though it is a great API. My use case is that I want to make a whole bunch of rate limited URL fetch calls while

Throttle JavaScript function calls, but with queuing (don't discard calls)

时光毁灭记忆、已成空白 提交于 2019-12-03 16:58:43
问题 How can a function rate-limit its calls? The calls should not be discarded if too frequent, but rather be queued up and spaced out in time, X milliseconds apart. I've looked at throttle and debounce, but they discard calls instead of queuing them up to be run in the future. Any better solution than a queue with a process() method set on an X millisecond interval? Are there such standard implementations in JS frameworks? I've looked at underscore.js so far - nothing. 回答1: Should be rather

What is TombstonedTaskError from App Engine's Task Queue?

旧巷老猫 提交于 2019-12-03 14:29:24
问题 What does the TombstonedTaskError mean? It is being raised while trying to add a task to the queue, from a cron-job: Traceback (most recent call last): File "/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 501, in __call__ handler.get(*groups) File "/base/data/home/apps/.../tasks.py", line 132, in get ).add(queue_name = 'userfeedcheck') File "/base/python_lib/versions/1/google/appengine/api/labs/taskqueue/taskqueue.py", line 495, in add return Queue(queue_name).add

Checking status of Task Queue in Google App Engine

*爱你&永不变心* 提交于 2019-12-03 13:19:44
I'm putting several tasks into a task queue and would like to know when the specific tasks are done. I haven't found anything in the API about call backs, or checking the status of a task, so I thought I'd see what other people do, or if there's a work around (or official) way to check. I don't care about individual tasks, if it helps, I'm putting 6 different tasks in, and want to know when all 6 are complete. Thanks! The new REST/JSON task queue API will let you do this. http://code.google.com/appengine/docs/python/taskqueue/rest.html This does not scale well to thousands of tasks... I do

Creating a execution queue by using Task.ContinueWith?

血红的双手。 提交于 2019-12-03 10:07:18
问题 I have several actions that I want to execute in the background, but they have to be executed synchronously one after the other. I was wondering if it's a good idea to use the Task.ContinueWith method to achieve this. Do you foresee any problems with this? My code looks something like this: private object syncRoot =new object(); private Task latestTask; public void EnqueueAction(System.Action action) { lock (syncRoot) { if (latestTask == null) latestTask = Task.Factory.StartNew(action); else

Creating a execution queue by using Task.ContinueWith?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 00:34:13
I have several actions that I want to execute in the background, but they have to be executed synchronously one after the other. I was wondering if it's a good idea to use the Task.ContinueWith method to achieve this. Do you foresee any problems with this? My code looks something like this: private object syncRoot =new object(); private Task latestTask; public void EnqueueAction(System.Action action) { lock (syncRoot) { if (latestTask == null) latestTask = Task.Factory.StartNew(action); else latestTask = latestTask.ContinueWith(tsk => action()); } } This should work as designed (using the fact

Creating a python priority Queue

痞子三分冷 提交于 2019-12-02 15:48:24
问题 I would like to build a priority queue in python in which the queue contains different dictionaries with their priority numbers. So when a "get function" is called, the dictionary with the highest priority(lowest number) will be pulled out of the queue and when "add function" is called, the new dictionary will be added to the queue and sorted based on its priority number. Please do help out... Thanks in advance! 回答1: Use the heapq module in the standard library. You don't specify how you

Background processes in Node.js

我怕爱的太早我们不能终老 提交于 2019-12-02 14:00:26
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 Job. What is the Node equivalent of this API? If you want something lightweight, that runs in the same

Creating a python priority Queue

て烟熏妆下的殇ゞ 提交于 2019-12-02 11:40:19
I would like to build a priority queue in python in which the queue contains different dictionaries with their priority numbers. So when a "get function" is called, the dictionary with the highest priority(lowest number) will be pulled out of the queue and when "add function" is called, the new dictionary will be added to the queue and sorted based on its priority number. Please do help out... Thanks in advance! Use the heapq module in the standard library. You don't specify how you wanted to associate priorities with dictionaries, but here's a simple implementation: import heapq class