background-process

Symfony and Heroku worker: can I use the database as communication mechanism between the front-end and the background worker?

[亡魂溺海] 提交于 2020-01-07 04:02:10
问题 I need an Heroku's Worker to do some background tasks. Now, reading the article Background jobs with workers in PHP , I found that the architecture designed in the article makes use of RabbitMQ as messaging system between the web dyno and the worker dyno. But I don't want to use RabbitMQ as it is really too much complex at this stage. So, as communication mechanism between web dyno and worker dyno , I'd like to use one of these two alternatives: Simply the database (largely my best choice :P)

How to background a sleep in arduino?

我的未来我决定 提交于 2020-01-06 14:17:29
问题 I am just starting with arduino and I already love it. One of the projects I would like to try deals with the follwing pseudo-code flow: def switch(): set_pin_2_to_HIGH wait_10_seconds set_pin_2_to_LOW loop() // some time sensitive code, which should be executed on a // reasonably regular cycle if_pin_1_is_HIGH: switch() // some more code where the state of pin_2 will be tested, that code also need // to run in a reasonably regular cycle I therefore need the loop to loop without stopping 10

How to keep recording key strokes while program not in focus (in background) in F#?

独自空忆成欢 提交于 2020-01-06 07:10:34
问题 The code below is part of a bigger ML project, but I want it to run while it's minimised too. How can I do this? I think I need to run it as a windows process to achieve this, but there isn't much information on how to do that in F#. Or is there another way? let rec f() = let c = System.Console.ReadKey().KeyChar printfn "%c" c f() f() 回答1: From the link in Aaron's comment I decided to give the port a try. This works for me. Note that this could definitely be cleaned up a bit more. I placed

Run controller methods in background Codeigniter Windows

不想你离开。 提交于 2020-01-06 02:59:05
问题 I'll start with what my program does. The index function of controller takes an array of URLs and keywords and stores them in DB. Now the crawlLink method with take all the keywords and URLs. The URLs are searched for all the keywords and the sublinks of all the URLs are generated and again stored in DB which are also searched for the keywords. Keywords are searched in each link using search method. The sublinks are extracted from all the URLs using extract_links function. search and extract

Parallel background tasks on single worker dyno

假装没事ソ 提交于 2020-01-05 11:09:27
问题 We've got a Rails app where certain requests trigger long-running tasks on a worker dyno with delayed_job, while the front-end polls until it receives a result. Our traffic is small but growing, and the tasks generally take only a few seconds to complete, but can take up to a minute. Right now a single web and worker dyno each should be sufficient to handle our load. The problem is, the delayed_job queue won't process jobs in parallel, so a longer task ends up holding up the tasks behind it.

How can you update location data in Windows Phone in the background?

我只是一个虾纸丫 提交于 2020-01-05 10:25:24
问题 I just read that while Windows Phone 7.5 background tasks can poll for a location, they don't actually poll real-time from the GPS but rather the location API calls return a system-cached position that's only updated once every fifteen minutes. That limitation of course completely invalidates any attempt at having navigation run in the background as you can get pretty damn far off-track in fifteen minutes, let alone that a background task can only run once every thirty minutes or so! That

Prevent iOS from killing my app after 3 minutes

好久不见. 提交于 2020-01-03 07:05:09
问题 To avoid implementing a persistent caching logic of a whole navigation stack I want to keep my app "alive" (at least for 2 hours) even in the background, so when the user reopens the app it is where it was before going to sleep. I tried with a background task: _timerBackgroundTaskId = UIApplication.SharedApplication.BeginBackgroundTask(() => { // Run some dummy code here. Shouldn´t this prevent the task from actually stopping? var remaining = UIApplication.SharedApplication

iOS app running in the background

别说谁变了你拦得住时间么 提交于 2020-01-03 04:59:05
问题 I am trying to be able to set how long my app will remain in the background. I want to be able to have the control over how long my app can stay active in the background until it is closed. Is there something I can add to the Info.plist that can set that, with the bool that is the switch to have it run in the background or not? I have read and found that Apple doesn't let apps remain in the background for longer than 10min, but I have done some testing and found other live apps that are

User already has more than 'max_user_connections' active connections HANGFIRE

时光毁灭记忆、已成空白 提交于 2020-01-03 02:21:06
问题 I understand User already has more than 'max_user_connections' active connections has already many answers. But this is in regard to Hangfire. I am using Hangfire for background processing. It worked fine for the first time and only when I started my application. But now its not. SO now when I am trying to open the database to see what's happening it gives me this error. My idea is that it cannot execute any more items in the queue because it cannot connect to the database. Also, I cannot

NSURLSession post : difference between uploadTask and dataTask

≡放荡痞女 提交于 2020-01-02 01:09:16
问题 These are my two examples : let config = NSURLSessionConfiguration.defaultSessionConfiguration() config.HTTPAdditionalHeaders = ["Accept": "application/json", "Content-Type": "application/json", "User-Agent": UIDevice.currentDevice().model] var request = NSMutableURLRequest(URL: NSURL(string: "http://XXX")) request.HTTPMethod = "POST" let valuesToSend = ["key":value, "key2":value] var error: NSError? let data = NSJSONSerialization.dataWithJSONObject(valuesToSend, options:NSJSONWritingOptions