task

How To Programmatically Create & Pause Google App Engine Task Queues

老子叫甜甜 提交于 2019-12-23 12:17:49
问题 I'm using Google App Engine and I've been using a named push queue to process some tasks. The queue was defined and configured using queue.xml. That's fine. Now I'm trying to do more: 1) Is there a way to dynamically create and configure a new queue in Java "on the fly"? 2) Also, once I have a queue (either through queue.xml or 1) if possible), is there a way to pause and resume the queue in Java (just like you can do using the admin console buttons)? Thanks! 回答1: 1) since it has to be in the

No-freezes alternative to Thread.Sleep for waiting inside a Task [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 12:14:25
问题 This question already has answers here : Wpf Label not being updated when using Thread.Sleep() (3 answers) Closed 5 years ago . I have to call a web API that works as follows : upload a song request a particular analysis on that song wait that the process is finished retrieve and return the result I am having a problem with no. 3, I've tried Thread.Sleep but that freezes the UI. How can I wait in a task without freezing the UI ? public override async Task Execute(Progress<double> progress,

Run Multiple Tasks (Variable Number) in parallel and continue when all have finished

落花浮王杯 提交于 2019-12-23 12:07:09
问题 I need to start a "number" of tasks (variable but less than 10) not in parallel, and wait for them all to finish, getting from each the result. I'm getting the result from each of them, saving in a list and then using it in the end. Here's my code, and it's working but I think there gotta be a cleaner way to do that. CAUSING THE NUMBER OF TASKS List<String> Arguments = new List<String> { "AA", "BB", "CC" }; List<String> ResultList = new List<String>(); //**AT LEAST I'VE GOT ONE** Task<String>

Run Multiple Tasks (Variable Number) in parallel and continue when all have finished

只谈情不闲聊 提交于 2019-12-23 12:06:12
问题 I need to start a "number" of tasks (variable but less than 10) not in parallel, and wait for them all to finish, getting from each the result. I'm getting the result from each of them, saving in a list and then using it in the end. Here's my code, and it's working but I think there gotta be a cleaner way to do that. CAUSING THE NUMBER OF TASKS List<String> Arguments = new List<String> { "AA", "BB", "CC" }; List<String> ResultList = new List<String>(); //**AT LEAST I'VE GOT ONE** Task<String>

how to restrict the concurrent running map tasks?

自古美人都是妖i 提交于 2019-12-23 09:19:47
问题 My hadoop version is 1.0.2. Now I want at most 10 map tasks running at the same time. I have found 2 variable related to this question. a) mapred.job.map.capacity but in my hadoop version, this parameter seems abandoned. b) mapred.jobtracker.taskScheduler.maxRunningTasksPerJob (http://grepcode.com/file/repo1.maven.org/maven2/com.ning/metrics.collector/1.0.2/mapred-default.xml) I set this variable like below: Configuration conf = new Configuration(); conf.set("date", date); conf.set("mapred

Is there a callback for when a task is completed in Task.WhenAll

大城市里の小女人 提交于 2019-12-23 09:01:46
问题 Suppose I have the following: IEnumerable<Task<TimeSpan>> tasks = //... TimeSpan[] results = await Task.WhenAll(tasks); // Handle results By the time I can handle the results all the task must have finished. Is there a way to handle each result on demand ? Like registering a delegate / callback that will get executed when a task is completed: IEnumerable<Task<TimeSpan>> tasks = //... await Task.WhenAll(tasks, result => { // A task has finished. This will get executed. // result is of type

Tasklist replacement for Visual Studio

喜夏-厌秋 提交于 2019-12-23 08:46:42
问题 I would like to use the task-list in Visual Studio but it really lacks almost any useful feature a task-list should provide. So I use Todo-List externally, to keep track of the things I need to get done. Would be nice to have it all in one place. So does anyone know of a cool replacement Add-On for the tasklist in Visual Studio? Thanks in advance! 回答1: How about the FogBugz add-in for Visual Studio 2005 and 2008? This requires a FogBugz account hosted either locally or by Fog Creek. A free

Tasklist replacement for Visual Studio

情到浓时终转凉″ 提交于 2019-12-23 08:46:13
问题 I would like to use the task-list in Visual Studio but it really lacks almost any useful feature a task-list should provide. So I use Todo-List externally, to keep track of the things I need to get done. Would be nice to have it all in one place. So does anyone know of a cool replacement Add-On for the tasklist in Visual Studio? Thanks in advance! 回答1: How about the FogBugz add-in for Visual Studio 2005 and 2008? This requires a FogBugz account hosted either locally or by Fog Creek. A free

Task.Faulted and Task.Exception

空扰寡人 提交于 2019-12-23 08:33:33
问题 Neither TaskStatus Enum or Task.Exception MSDN appear to state explicity: Does TasksStatus.Faulted ALWAYS imply Task.Exception != null (and TaskStatus != Faulted always imply Task.Exception == null )? 回答1: Yes the documentation for Task.IsFaulted explicitly states that: If IsFaulted is true, the task's Status will be equal to Faulted, and its Exception property will be non-null. The reference source code does list the as an almost certainly. In FinishStageTwo we see that the internal m_state

Passing data from a BroadcastReceiver to MainActivity works correctly only once

六月ゝ 毕业季﹏ 提交于 2019-12-23 05:46:31
问题 I have a PushNotificationReceiver (extends BroadcastReceiver) and MainActivity . The receiver sends some data (for example string value " New value ") to the MainActivity via an Intent . Then MainActivity updates its TextView with this value. This works fine until I change this TextView value to some other value (for example reset it to " UNSPECIFIED ") and move the activity to background and to foreground again. The MainActivity is restored and its TextView contains " New value ", however I