long-running-processes

Cancel a long running task over WCF from client

眉间皱痕 提交于 2019-12-18 17:00:59
问题 I have a WCF service set to PerCall I would like to know how I can send a Start call from the client to start a long running process, and send a Cancel command to cancel it My WCF service looks something like this [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class Service1 : IService1 { CancellationTokenSource cancelToken = new CancellationTokenSource(); public void Start() { var compute = Task.Factory.StartNew(StartLongRunningTask, cancelToken.Token); } public

Python - Launch a Long Running Process from a Web App

拜拜、爱过 提交于 2019-12-18 12:35:18
问题 I have a python web application that needs to launch a long running process. The catch is I don't want it to wait around for the process to finish. Just launch and finish. I'm running on windows XP, and the web app is running under IIS (if that matters). So far I tried popen but that didn't seem to work. It waited until the child process finished. 回答1: Ok, I finally figured this out! This seems to work: from subprocess import Popen from win32process import DETACHED_PROCESS pid = Popen(["C:

Work managers threads constraint and page cannot be displayed

左心房为你撑大大i 提交于 2019-12-13 04:46:38
问题 We have a memory intensive processing for certain functionality and we would like to limit the number of parallel requests to this processing. We are able to configure by using "Work Managers" in WebLogic and putting a limit on the number of threads for that servlet. For example, if we put maximim thread limit as 3, then if there are 10 parallel requests; 7 requests are in queue. There could be situations where these the requests waiting in queue could take up to 30-40 minutes to be processed

Common Ways of handling long running process in ASP.NET

房东的猫 提交于 2019-12-12 19:09:55
问题 We have a long running data transfer process that is just an asp.net page that is called and run. It can take up to a couple hours to complete. It seems to work all right but I was just wondering what are some of the more popular ways to handle a long process like this. Do you create an application and run it through windows scheduler, or a web service or custom handler? 回答1: In a project for long running tasks in web-application, i made a windows service. whenever the user has to do the time

How can I prevent Sidekiq processing new jobs based on code version?

梦想的初衷 提交于 2019-12-11 06:56:26
问题 We are deploying versions of a sidekiq worker to Cloud Foundry as part of a continuous delivery pipeline. We need to stop workers processing new jobs if they are no longer the latest version. So: Worker v1 is running and performing a 30 min job. We deploy v2 of the worker code. v1 should continue with current jobs but not start any new ones. CloudFoundry won't allow us to send USR1, so we need a solution that allows the workers to determine if they are the latest version before every job

How to lock a long async call in a WebApi action?

 ̄綄美尐妖づ 提交于 2019-12-11 06:08:13
问题 I have this scenario where I have a WebApi and an endpoint that when triggered does a lot of work (around 2-5min). It is a POST endpoint with side effects and I would like to limit the execution so that if 2 requests are sent to this endpoint (should not happen, but better safe than sorry), one of them will have to wait in order to avoid race conditions. I first tried to use a simple static lock inside the controller like this: lock (_lockObj) { var results = await _service

Is it the correct implementation?

非 Y 不嫁゛ 提交于 2019-12-08 16:54:07
问题 I am having a Windows Service that needs to pick the jobs from database and needs to process it. Here, each job is a scanning process that would take approx 10 mins to complete. I am very new to Task Parallel Library. I have implemented in the following way as sample logic: Queue queue = new Queue(); for (int i = 0; i < 10000; i++) { queue.Enqueue(i); } for (int i = 0; i < 100; i++) { Task.Factory.StartNew((Object data ) => { var Objdata = (Queue)data; Console.WriteLine(Objdata.Dequeue());

Winform updates on long running tasks

别说谁变了你拦得住时间么 提交于 2019-12-07 05:06:27
问题 Do you have a good solution for keeping a 'Please wait' winform 'painted' while an application is performing a long running task ? I've tried using form.refresh() on each step, but there are a few long running queries that take place, which means that this isn't frequent enough. Basically this SO Question but, on C# in Excel through VSTO (rather than Python). 回答1: Here's a good example with code in C#. It is for splash screens specifically, however it is almost identical process (perhaps

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

三世轮回 提交于 2019-12-06 01:38:51
问题 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

Winform updates on long running tasks

随声附和 提交于 2019-12-05 10:41:26
Do you have a good solution for keeping a 'Please wait' winform 'painted' while an application is performing a long running task ? I've tried using form.refresh() on each step, but there are a few long running queries that take place, which means that this isn't frequent enough. Basically this SO Question but, on C# in Excel through VSTO (rather than Python). Here's a good example with code in C#. It is for splash screens specifically, however it is almost identical process (perhaps minus some of the flashy Opacity) to create a Please wait window. The key information is that you will need a