background-process

HealthStore enableBackgroundDelivery when screen is locked

不想你离开。 提交于 2019-11-30 05:44:37
Hello I'm trying to setup the health store observer with background delivery enabled. My problem is that it won't deliver anything when the screen is locked. I have simplified my code for this question to get to the point :) I have HealthKit in my plist and I have accepted healthStore type step count. Everything is fine when the app is open and when the screen is not locked. But when the screen is locked I don't get any observations. For test purpose the frequency is set to immediate. My code is as follows - (void)setupHealthStore{ if ([HKHealthStore isHealthDataAvailable]) { NSSet

swift/ios refreshing app data when in background

本小妞迷上赌 提交于 2019-11-30 05:14:30
I'm writing a iOS/Swift application which reads data from a REST service each X minutes and updates the UI accordingly. Now I would like that when the app is put in the background, a task keeps being invoked at X minutes intervals reading from the REST service and, in case the data just read satisfies a given condition, show a notification prompting the user to bring the app back to the foreground. In my searches I've read that during applicationDidEnterBackground event, I should start a task with beginBackgroundTaskWithExpirationHandler . The problem is that, if I've understood correctly,

launching background process in capistrano task

无人久伴 提交于 2019-11-30 05:06:08
capistrano task namespace :service do desc "start daemontools (svscan/supervise/svscanboot)" task :start, :roles => :app do sudo "svscanboot&" end end Now this doesn't work: the svscanboot process simply doesn't run. This helped me find sleep : https://github.com/defunkt/resque/issues/284 other sources pointed me to nohup , redirection , and pty => true , so I tried all these. run "nohup svscanboot >/tmp/svscanboot.log 2>&1 &" # NO run "(svscanboot&) && sleep 1" # NO run "(nohup svscanboot&) && sleep 1" # YES! Now, could anyone explain to me why i need the sleep statement and what difference

ASP.NET Core IHostedService manual start/stop/pause(?)

穿精又带淫゛_ 提交于 2019-11-30 04:58:49
I would like to implement a recurring (timed) IHostedService instance in ASPNET Core that can be stopped and started on demand. My understanding is that IHostedService(s) are started by the framework on application startup. However, I would like to be able to start/stop the service 'manually', perhaps using an on/off toggle via a UI. Ideally the "off" state would dispose of currently running service, and the "on" state would then create a new instance. I've read the MS docs here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-2.1 . My initial

Background fetch is not working after killing the app

我的未来我决定 提交于 2019-11-30 03:09:40
问题 I'm trying to get data from url with background fetch. My func tries to get data and if there is a new data, it sends local notification. Background fetch works after about 10 - 20 minutes when i minimize the app. But when i kill the app (double click home button and close app) it doesn't work. I waited about 1 hour but it didn't work. I am using background service in android and it is working successfully. Is there any way to get data from url and send local notification when app is closed?

DbContext for background tasks via Dependency Injection

给你一囗甜甜゛ 提交于 2019-11-30 00:20:57
I am probably not thinking in the right direction. I am fairly new to Dependency Injection and ASP.Net Core. I have a ASP.Net core website, and one of the tasks is to import data from an excel sheet to a database that a user will upload. The excel sheets can be huge and the data transformation tasks are time taking, hence I wish to perform them in the background. i.e. The user will upload the sheet, the response will be sent immediately and the background job/thread will import the data. I am trying to run the background job by: Task.Run(() => ProcessImport(model)); The problem I run into is

Detect end of TCL background process in a TCL script

元气小坏坏 提交于 2019-11-29 23:25:21
问题 I'm working on a program the uses an EXEC command to run a make file. This can take a long time so I want to put it in the background so the GUI doesn't lock up. However I also want the GUI to be disabled and a progress bar to run only while the make file is compiling. So how can I detect when a background progress has finished in TCL? Edit: It gets more complicated because my boss wants the command window to stay open (or be visable) so the user can see the progress of the make and see if it

Running iOS App in background for more than 10 minutes

青春壹個敷衍的年華 提交于 2019-11-29 23:23:49
I am trying to allow my app to run in the background for more that 10 minutes, according to this and my good below. (I want to use long background running to keep track of a location, my code here simply just use a counter for testing purposes) Anyone can help point out what the problem is? Implementing Long-Running Background Tasks For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background: Apps that play audible content to the

Alternative solution to HostingEnvironment.QueueBackgroundWorkItem in .NET Core

六眼飞鱼酱① 提交于 2019-11-29 22:52:17
We are working with .NET Core Web Api, and looking for a lightweight solution to log requests with variable intensity into database, but don't want client's to wait for the saving process. Unfortunately there's no HostingEnvironment.QueueBackgroundWorkItem(..) implemented in dnx , and Task.Run(..) is not safe. Is there any elegant solution? Axel Heer QueueBackgroundWorkItem is gone, but we've got IApplicationLifetime instead of IRegisteredObject , which is being used by the former one. And it looks quite promising for such scenarios, I think. The idea (and I'm still not quite sure, if it's a

Perform task on background thread in iOS, keep execution running even when the application enters background: [closed]

时间秒杀一切 提交于 2019-11-29 21:55:52
问题 How to perform execution on a background thread? Execution should continue in the background even if the user presses the home button. 回答1: Add these properties to your .h file @property (nonatomic, strong) NSTimer *updateTimer; @property (nonatomic) UIBackgroundTaskIdentifier backgroundTask; Now suppose you have a action on button --> btnStartClicked then your method would be like : -(IBAction)btnStartClicked:(UIButton *)sender { self.updateTimer = [NSTimer scheduledTimerWithTimeInterval:0.5