background-process

iPhone : Running services in the background

烂漫一生 提交于 2019-12-03 21:31:59
Having a look around, am I correct in thinking that the only type of background services are audio, voip and location services and so that if I wanted to communicate with a server I have to use push notifications. This means that badges are only uses for push notifications. Update: I want to check for updates on the server every 5 minutes or so. So the device is checking the server, not the server pushing to the device. I suppose email is an example. It polls the server. Thanks Simon You have a number of options: Push Notifications This is the most friendly for battery and device resources;

Is there a way for a backgrounded task to inform the terminal to print a new prompt?

淺唱寂寞╮ 提交于 2019-12-03 21:02:16
I want to write a program that can be run as a backgrounded task (i.e. my-thing & ), and that will beautifully provide relevant output when necessary. However, with background tasks that print to the terminal, there's always this annoying little progression: bash-3.2$ my-thing & ▏ bash-3.2$ my-thing & bash-3.2$ -- Hello from my-thing! -- now let me start doing what I do best ... ▏ … notice that we now have no prompt before the cursor, not to mention that there's an ugly erraneous prompt where my program spat out output while a prompt had already been printed. Thus, I want three things, only

HttpClient GetAsync fails in background task on Windows 8

假装没事ソ 提交于 2019-12-03 19:55:59
问题 I have a Win RT app that has a background task responsible for calling an API to retrieve data it needs to update itself. However, I've run into a problem; the request to call the API works perfectly when run outside of the background task. Inside of the background task, it fails, and also hides any exception that could help point to the problem. I tracked this problem through the debugger to track the problem point, and verified that the execution stops on GetAsync. (The URL I'm passing is

How to get PID from PHP function exec() in Windows?

荒凉一梦 提交于 2019-12-03 17:36:56
问题 I have always used: $pid = exec("/usr/local/bin/php file.php $args > /dev/null & echo \$!"); But I am using an XP virtual machine to develop a web app and I have no idea how to get the pid in windows. I tried this on a cmd: C:\\wamp\\bin\\php\\php5.2.9-2\\php.exe "file.php args" > NUL & echo $! And it gets the file executed, but the output is "$!" How can I get the pid into the var $pid? (using php) 回答1: You will have to install an extra extension, but found the solution located at

How to detect if python script is being run as a background process

拈花ヽ惹草 提交于 2019-12-03 17:21:06
问题 Is there a way to tell whether my python script is running as a background process or not? I'm trying to differentiate between these two: sudo ./myscript.py sudo ./myscript.py & Using sys.argv doesn't work - the ampersand doesn't count as an argument apparently. And what would be the effect of the following instead: sudo python myscript.py sudo python myscript.py & I've had a look around, but everything seems to be about starting a background process from within a Python script, not whether

How can I keep my app running in the background?

你说的曾经没有我的故事 提交于 2019-12-03 16:35:22
I am creating an application in which I need to always be connected via a TCP socket. My application already works well in terms of the connection, but when it gets sent to the background, the android system eventually kills the process. This causes it to become disconnected from the server. I've been looking for a way to always keep the application alive, but haven't found anything. Could someone tell me what would be the best way to make it so that my application is not closed when it's in the background, or, barring this, make it restart itself if it is closed? I'm starting with this and is

How to run Console Application in Background (no UI)? [duplicate]

落花浮王杯 提交于 2019-12-03 14:59:12
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: .Net Console Application that Doesn’t Bring up a Console I have a console application written in VB.NET that will become a scheduled task on a web server. It will run every ten minutes. The problem is that every ten minutes it displays the empty black CMD window while processing, which can be distracting. How can I configure it to run in the background (with no CMD window displayed)? 回答1: Set on your Project in

Running a php script via ajax, but only if it is not already running

人盡茶涼 提交于 2019-12-03 11:21:45
My intention is this. My client.html calls a php script check.php via ajax. I want check.php to check if another script task.php is already being run. If it is, I do nothing. If it is not, I need to run it in the background. I have an idea what I want to do, but am unsure how to do it. Part A. I know how to call check.php via ajax. Part B. In check.php I might need to run task.php. I think I need something like: $PID = shell_exec("php task.php > /dev/null & echo $!"); I think the "> /dev/null &" bit tells it to run in the background, but am unsure what the "$!" does. Part C. The $PID I need as

Running a command as a background process/service

孤者浪人 提交于 2019-12-03 11:07:56
I have a Shell command that I'd like to run in the background and I've read that this can be done by suffixing an & to the command which causes it to run as a background process but I need some more functionality and was wondering how to go about it: I'd like the command to start and run in the background every time the system restarts. I'd like to be able to able to start and stop it as and when needed just like one can do service apache2 start . How can I go about this? Is there a tool that allows me to run a command as a service? I'm a little lost with this. Thanks Sorpigal Take a look at

macOS menubar application: main menu not being displayed

与世无争的帅哥 提交于 2019-12-03 09:41:08
问题 I have a statusbar application, which runs in the menu bar. Therefore I set Application is agent (UIElement) to true in the info.plst . That results in no dock icon and no menu bar for my application. However, I also have a preference window that the user can open from the statusbar menu. Here is how I open it: if (!NSApp.setActivationPolicy(.regular)) { print("unable to set regular activation policy") } NSApp.activate(ignoringOtherApps: true) if let window = preferencesWindowController