long-running-processes

Keep background service running after killing an application

£可爱£侵袭症+ 提交于 2019-12-04 21:06:12
I have developed an android application which runs background service, I need the service to stay alive even if the application is killed by user or for some reason. I have implemented the service and add return START_STICKY in onStartCommand method like this: public int onStartCommand(Intent intent, int flags, int startId) { super.onStartCommand(intent, flags, startId); Log.d("my_state","On start command"); return START_STICKY; } also I defined the service in AndroidManifest.xml like this: <service android:name=".MeterDistanceCalcService" android:exported="true" android:enabled="true" android

python long running daemon job processor

时光怂恿深爱的人放手 提交于 2019-12-04 16:47:34
I want to write a long running process (linux daemon) that serves two purposes: responds to REST web requests executes jobs which can be scheduled I originally had it working as a simple program that would run through runs and do the updates which I then cron’d, but now I have the added REST requirement, and would also like to change the frequency of some jobs, but not others (let’s say all jobs have different frequencies). I have 0 experience writing long running processes, especially ones that do things on their own, rather than responding to requests. My basic plan is to run the REST part

Launching a long-running background task - from ASP.NET or a scheduled job

落爺英雄遲暮 提交于 2019-12-04 16:27:22
I have a fairly long-running process (several minutes) that I need to run roughly once a month - but not on a fixed schedule, but after a user clicks Go in a ASP.NET Webforms GUI page. Since ASP.NET really isn't designed to handle long-running background tasks, my idea was to put this into a separate console app. But how to launch that as needed? What happens if I use Process.Start(....) from my ASP.NET page's code-behind? I would like to avoid blocking the whole Web UI for 20 minutes or so... and also: even if it doesn't block my UI, what happens to my long-running task if the ASP.NET app

Best practice for processing a lot of data while the user waits (in Rails)?

亡梦爱人 提交于 2019-12-04 09:02:34
I have a bookmarklet that, when used, submits all of the URLs on the current browser page to a Rails 3 app for processing. Behind the scenes I'm using Typhoeus to check that each URL returns a 2XX status code. Currently I initiate this process via an AJAX request to the Rails server and simply wait while it processes and returns the results. For a small set, this is very quick, but when the number of URLs is quite large, the user can be waiting for up to, say, 10-15 seconds. I've considered using Delayed Job to process this outside the user's thread, but this doesn't seem like quite the right

Recommendations for designing a long-running, resource-intensive web service

亡梦爱人 提交于 2019-12-04 06:27:06
I have a .NET function that does some complex calculation. Depending on the parameters that are passed in, the function: Takes anywhere from several minutes to several hours to run Uses 100% of a single core during the computation Requires anywhere from 100s of MB to several GB of memory Writes anywhere from several MB to several GB of data to disk May throw an exception, including an OutOfMemoryException The amount to data to be written to disk can be accurately predicted from the function parameterisation. There is no easy way to predict the other resource requirements from the function

Long running webservice architecture

爷,独闯天下 提交于 2019-12-04 01:58:06
问题 We use axis2 for building our webservices and a Jboss server to run the logic of all of our applications. We were asked to build a webservice that talks to a bean that could take up to 1 hour to respond (depending on the size of the request) so we would not be able to keep the connection with the consumers opened during that time. We could use an asynchronous webservice but that hasn't come out all that well so we decided we could implement a bean that will do the logic behind the webservice

IntelliJ IDEA + Gradle - How can I log a long running Gradle task run from the IDE?

你离开我真会死。 提交于 2019-12-01 23:41:26
IntelliJ IDEA sometimes takes a long time to do a Gradle refresh task or run a Gradle task. It will just kinda spin for a long time leaving you wondering how far along it is or if it's even doing anything at all or frozen? For example this has been running for a long time: But I have no way to see what is happening? Where are the logs? Here is a long running refresh: There is no way to get the logs from IntelliJ IDEA when Gradle project is imported/refreshed, please vote for the feature request: IDEA-157505 View Gradle output when importing project 来源: https://stackoverflow.com/questions

IntelliJ IDEA + Gradle - How can I log a long running Gradle task run from the IDE?

∥☆過路亽.° 提交于 2019-12-01 22:03:44
问题 IntelliJ IDEA sometimes takes a long time to do a Gradle refresh task or run a Gradle task. It will just kinda spin for a long time leaving you wondering how far along it is or if it's even doing anything at all or frozen? For example this has been running for a long time: But I have no way to see what is happening? Where are the logs? Here is a long running refresh: 回答1: There is no way to get the logs from IntelliJ IDEA when Gradle project is imported/refreshed, please vote for the feature

Long running webservice architecture

隐身守侯 提交于 2019-12-01 11:47:58
We use axis2 for building our webservices and a Jboss server to run the logic of all of our applications. We were asked to build a webservice that talks to a bean that could take up to 1 hour to respond (depending on the size of the request) so we would not be able to keep the connection with the consumers opened during that time. We could use an asynchronous webservice but that hasn't come out all that well so we decided we could implement a bean that will do the logic behind the webservice and have the service invoke that bean asynchronously. The webservice will generate a token that will

Pattern for long-running operation with cancellation ability

巧了我就是萌 提交于 2019-12-01 00:22:02
In order to perform long-running (let it be search in this context) operation, I put the loading logic inside a TPL task, so the general method Search() is called on background thread. Search() operation can be long enough, so I need the ability to cancel it properly, using the CancellationToken . But the Search() operation did not return until it finished, so I have to do some logic in order to implement convenient and (!) fast cancellation. Using WaitHandle's I can implement something like this: private void StartSearch() // UI thread { CancellationTokenSource s = new CancellationTokenSource