task

After Task.IsCompleted what is better: await or Result [duplicate]

天涯浪子 提交于 2019-12-13 09:06:29
问题 This question already has answers here : Await on a completed task same as task.Result? (2 answers) Is there a difference between calling .Result or await on known completed tasks? [duplicate] (1 answer) Closed 2 months ago . I'm working in a simple timeout code for my http requests. I got this private async Task<HttpResponseMessage> ExecuteIOTask(Task<HttpResponseMessage> ioTask, int timeout) { var timeoutTask = await Task.WhenAny(Task.Delay(timeout), ioTask); if (ioTask.IsCompleted) return

WKWatchConnectivityRefreshBackgroundTask example

社会主义新天地 提交于 2019-12-13 07:05:23
问题 I want to pass data from my iOS App to my watchOS 3 app using WKWatchConnectivityRefreshBackgroundTask How do I set up code in my watchOS App to handle the data being transferred? For example in the past I used this iOS code to send a message from the iOS App and if there was no connection send a context: func sendTable() { let tableInfo: WatchWorkout = PhoneData().buildWatchTableData(Foundation.Date().refDays()) let archivedTable: Data = NSKeyedArchiver.archivedData(withRootObject: tableInfo

gulp-tag-version running command?

主宰稳场 提交于 2019-12-13 04:58:22
问题 I installed gulp-tag-version, but when I am running the command 'gulp tag v1.1.1', it will not confirm this as a task var gulp = require('gulp'); var tag_version = require('gulp-tag-version'); gulp.task('tag', function() { return gulp.src(['./package.json']).pipe(tag_version()); }); So what am I doing wrong ? 回答1: It looks like it has been added correct. The command however would be: gulp tag Which would look at the version in your package.json file and tag the last commit with it. Refer to

scheduling task in iphone

主宰稳场 提交于 2019-12-13 04:42:05
问题 I am developing an iphone app, there's a section in it where user can declare his task and its occurence in time. I.e. recursive task. The task will only show an alert box and nothing else when its due time. Its a kind of reminder, rather than a real task scheduler. What's the best way or technology to achieve that with objective-c, particularly on iphone. I was also thinking, if not too time consuming to implement, about some kind of integration with iphone calendar. Would it be nice to have

Httpclient Slow Memory Increase Issue - Using Tasks Multreaded Whenall

喜欢而已 提交于 2019-12-13 03:54:52
问题 using System; using System.ComponentModel; using System.IO; using System.Net.Http; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using System.Collections.Generic; using System.Collections.Concurrent; using System.Net; namespace Seranking_Scraper { public partial class Form1 : Form { public Form1() { InitializeComponent(); btnStop.Enabled = false; } CancellationTokenSource cts = null; List<string>

How to show loading dialog while a long time query is executed?

自古美人都是妖i 提交于 2019-12-13 02:38:06
问题 I created a winforms app with .net 4.0. First, I created a LoadingForm with cancel button, that must stop execution query. I want to create an ExecuteHelper class and LoadingForm with cancellation query button. public partial class LoadingFrm : DevExpress.XtraEditors.XtraForm { private Action _cancel; public LoadingFrm(Action a) { _cancel = a; InitializeComponent(); this.FormBorderStyle = FormBorderStyle.None; } private void simpleButton1_Click(object sender, EventArgs e) { this.close();

Propper JavaFX thread implementation

£可爱£侵袭症+ 提交于 2019-12-13 02:25:36
问题 In my GUI I have a TableView that should show a list of loaded files, after a class called PathGetter has finished loading them into an ObservableArrayList, but I just can't implement the task correctly. This is the important part in the JavaFX class browseButton.setOnAction(event -> { File dir = folderPicker.showDialog(bwindow); if(dir != null){ directoryLocation.setText(String.valueOf(dir)); bottom.getChildren().add(new javafx.scene.control.Label("Loading Tracks")); //PathGetter.getPath

variable list of dependencies for openmp 4.5 tasks

∥☆過路亽.° 提交于 2019-12-13 02:13:00
问题 I am writing a fortran code using task-based paradigm. I use my DAG to express the dependencies. Using OpenMP 4.5, I can use the clause depend which takes as input a dependence-type and a list of dependencies. This mechanism works well when you know explicitly the number of dependencies. However, in my case, I would create tasks that are expected to have a list of dependencies which varies from 1 to n elements. Reading the documentation OpenMP-4.5_doc, I have not found any useful mechanism

Task Scheduler status still shows as Running after a BAT completes its task

瘦欲@ 提交于 2019-12-13 02:11:45
问题 I'm attempting to create a batch file that I can use with Task Manager in Windows 7 to copy users' local Google Earth file to a network location where it can be backed-up. It appears that the BAT is running just fine, but the task does not complete or stop once it's done & continues to show a status of "running". Thanks in advanced for the suggestions! COPY/Y "C:\Users\lena.domain\AppData\LocalLow\Google\GoogleEarth\myplaces.kml" "\\server\u-users\Lena\system backup\Google Earth" cmd.exe /C

Linq calling task.Run accessing wrong member, deferred execution issue?

你说的曾经没有我的故事 提交于 2019-12-13 00:57:25
问题 I'm having a weird issue with a linq query using the wrong values. My code looks like this await Task.WhenAll((from item in itemsToProcess let taskCount = count++ select Task.Run(() => { process(item).Result; })) .AsParallel().ToArray()); Basically I have a list of 50k items that are getting called into a method that makes a web call. They are completely unrelated, can run in any order, and don't access anything shared. BUT, once in awhile, very randomly, it seems to pass the wrong item to