task

Firing Recurring Tasks At The Same Time

怎甘沉沦 提交于 2021-02-11 11:58:53
问题 I am trying to get 2 tasks to fire at the same time at a specific point in time, then do it all over again. For example, below is a task that waits 1 minute and a second task that waits 5 minutes. The 1 minute task should fire 5 times in 5 minutes and the 5 minute task 1 time, the 1 minute task should fire 10 times in 10 minutes and the 5 minute task 2 times, on and on and on. However, I need the 1 minute task to fire at the same time as the 5 minute. I was able to do this with System.Timers

delphi ITaskFolder.RegisterTaskDefinition not working

微笑、不失礼 提交于 2021-02-10 15:49:37
问题 I'm trying to create a task to windows task scheduler. Here's the code. procedure TForm1.Button1Click(Sender: TObject); var ts: ITaskService; tf: ITaskFolder; tf2: ITaskFolder; td: ITaskDefinition; tr: ITrigger; tt: ITimeTrigger; at: IAction; ae: IExecAction; rt: IRegisteredTask; begin CoInitializeEx(nil, COINIT_MULTITHREADED); CoCreateInstance(CLSID_TaskScheduler,nil,CLSCTX_INPROC_SERVER,IID_ITaskService,ts); ts.Connect(unassigned, unassigned, unassigned, unassigned); try tf := ts.GetFolder(

delphi ITaskFolder.RegisterTaskDefinition not working

笑着哭i 提交于 2021-02-10 15:48:27
问题 I'm trying to create a task to windows task scheduler. Here's the code. procedure TForm1.Button1Click(Sender: TObject); var ts: ITaskService; tf: ITaskFolder; tf2: ITaskFolder; td: ITaskDefinition; tr: ITrigger; tt: ITimeTrigger; at: IAction; ae: IExecAction; rt: IRegisteredTask; begin CoInitializeEx(nil, COINIT_MULTITHREADED); CoCreateInstance(CLSID_TaskScheduler,nil,CLSCTX_INPROC_SERVER,IID_ITaskService,ts); ts.Connect(unassigned, unassigned, unassigned, unassigned); try tf := ts.GetFolder(

How to call one task after completion of multiple tasks

独自空忆成欢 提交于 2021-02-10 14:48:51
问题 I have List tasks, these tasks do some irrelevant work. What I need is to show message box in case all the tasks did their work correctly. I tried few ways, but nothing worked properly for me. Simplest way could be use Task continuation = Tasks.WhenAll(tasks); continuation.ContinueWith(obj => { show messagebox }); but ContinueWith still runs for all tasks, not just for continuation task. I tried to set cancellation token or to use sign, but tasks run at same time, so it isn't working. I will

How to cancel all running sagas when navigating between page views

我与影子孤独终老i 提交于 2021-02-10 05:37:15
问题 I'm trying to find a simple and easy way to cancel all running sagas within a "page" when the user decides to navigate to another "page" within the app... We are not using routing, but instead each "page" is its own widget within a larger host application that is responsible for creating and loading each page when the user navigates... Currently, we are using redux-saga and have setup logic like so (simplified for brevity) when a page widget is created and loaded... // page-sagas export

Daily upload of file automation using batch script and WinSCP

情到浓时终转凉″ 提交于 2021-02-08 10:45:01
问题 So I do have a file that I generate weekly from a server using crontab in Linux side and transfer it to my PC. However, I am having a problem when try to send the file that I generate from a different server on Windows side using task scheduler. 回答1: Your command-line syntax is wrong. I'm assuming the \ftpBinverlog_%yyyy%-%mm%-%dd%.txt is the file, you want to download. It won't work, if you just specify it on command-line like you did. Also neither Windows scheduler, nor command-interpreter,

Daily upload of file automation using batch script and WinSCP

筅森魡賤 提交于 2021-02-08 10:44:24
问题 So I do have a file that I generate weekly from a server using crontab in Linux side and transfer it to my PC. However, I am having a problem when try to send the file that I generate from a different server on Windows side using task scheduler. 回答1: Your command-line syntax is wrong. I'm assuming the \ftpBinverlog_%yyyy%-%mm%-%dd%.txt is the file, you want to download. It won't work, if you just specify it on command-line like you did. Also neither Windows scheduler, nor command-interpreter,

Starting a task using delegate in C#

∥☆過路亽.° 提交于 2021-02-08 09:53:57
问题 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TaskStart { class Program { private static void PrintMessage() { Console.WriteLine("Hello Task library!"); } static void Main(string[] args) { //method 1 //Task.Factory.StartNew(() => { Console.WriteLine("Hello Task library!");}); //method 2 //Task task = new Task(new Action(PrintMessage)); //task.Start(); //method3 Task task = new Task(delegate { PrintMessage(); });

Chaining `Task<T>` dynamically and without blocking the thread

跟風遠走 提交于 2021-02-08 06:54:17
问题 I am trying to chain Task<T> objects in C# as done in JavaScript and without blocking the UI thread. I see there is a similar question here, but it uses the non-generic Task object as a return type of the process functions. I try to do the same with Task<T> . I also see that here is a closer question to my needs, but the accepted answer seems to use .Result twice, which I guess will block the UI thread. Also, note that I chain tasks dynamically, so I can't follow some easy workarounds. And

How ConfigureAwait(false) Prevent Ui Deadlocks

对着背影说爱祢 提交于 2021-02-08 06:31:12
问题 I Know that this question has been asked endlessly, but still. I think i am missing somthing. When we want updating UI( WinForm UI for the sake of argument ) in asynchronously manner. But we cannot using the async /await keyword and we have to use the ConfigureAwait(false). As i understand it "Tells" the task that it can resume itself on any available thread instead of waiting to to the main thread. Its preventing the deadlock by free the UI for not waiting for the long process to be