task

MVVMLight CanExecute not working until window click

放肆的年华 提交于 2021-02-08 06:10:08
问题 Quick note so I do not waste anyone's time. When installing MVVMLight from nuget I eventually get an error null : The term 'null' is not recognized as the name of a cmdlet, function, script file, or operable program . MVVMLight seems to work fine despite this except the issue that will be described below, but I wanted to mention this just in case. The Problem I am experiencing an issue with buttons not re-enabling after command execution completes. It seems they sometimes work if the

MVVMLight CanExecute not working until window click

橙三吉。 提交于 2021-02-08 06:06:14
问题 Quick note so I do not waste anyone's time. When installing MVVMLight from nuget I eventually get an error null : The term 'null' is not recognized as the name of a cmdlet, function, script file, or operable program . MVVMLight seems to work fine despite this except the issue that will be described below, but I wanted to mention this just in case. The Problem I am experiencing an issue with buttons not re-enabling after command execution completes. It seems they sometimes work if the

Task cancellation with async task

旧时模样 提交于 2021-02-08 05:27:34
问题 I'm trying to make use of cancellation tokens as described in this FAQ. This was my initial thought: private async void OnLoginButtonClicked(object sender, EventArgs e) { if (this.cancelToken == null) { this.cancelToken = new CancellationTokenSource(); } try { bool loginSuccess = await AsyncLoginTask(this.cancelToken.Token); if (loginSuccess) { // Show main page } } catch (OperationCanceledException ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } catch (Exception ex) { System

How to continue on first successful task, throw exception if all tasks fail

风格不统一 提交于 2021-02-08 05:22:45
问题 I am currently working on a web API that requires that I perform several different checks for rights and perform async operations to see if a user is allowed to make an API call. If the user can pass just one of the checks, they may continue, otherwise I need to throw an exception and boot them back out of the API with a 403 error. I'd like to do something similar to this: public async Task<object> APIMethod() { var tasks = new[] { CheckOne(), CheckTwo(), CheckThree() }; // On first success,

Android low memory killer & application back stack

你。 提交于 2021-02-07 20:59:29
问题 Android system may decide to remove an application process when the system is low on memory, so to reclaim resources for more important work ( ie. to start a service belongs to another application ). However, I couldn't be sure if it's possible for the Android system to remove ONLY application task ( back stack ) without touching the corresponding app process? If this is possible, it's also possible the system destroys the back stack activities by performing a call to each onDestroy()

Android low memory killer & application back stack

本小妞迷上赌 提交于 2021-02-07 20:57:50
问题 Android system may decide to remove an application process when the system is low on memory, so to reclaim resources for more important work ( ie. to start a service belongs to another application ). However, I couldn't be sure if it's possible for the Android system to remove ONLY application task ( back stack ) without touching the corresponding app process? If this is possible, it's also possible the system destroys the back stack activities by performing a call to each onDestroy()

Does the task still survive when the main thread that creates it has been killed in c#?

随声附和 提交于 2021-02-07 11:10:37
问题 I have a main thread that creates a task using: new TaskFactory(cancellationToken).StartNew(() => DoSomething(cancellationToken), TaskCreationOptions.LongRunning); I wonder if the task still survive when the main thread that creates the task has been killed in c#. 回答1: If a process' main thread is terminated, the process aborts. When a process is killed, all threads (and other owned resources) are closed/terminated/killed also. Therefore, if your process' main thread created a worker thread

C++ freeRTOS Task, invalid use of non-static member function

雨燕双飞 提交于 2021-02-07 09:13:51
问题 Where is the Problem? void MyClass::task(void *pvParameter){ while(1){ this->update(); } } void MyClass::startTask(){ xTaskCreate(this->task, "Task", 2048, NULL, 5, NULL); } But, I get this: error: invalid use of non-static member function I cannot find any useful doc to check where is the mistake, but i think that should be something like: (C++11's std::thread) e.g.: xTaskCreate(&MyClass::task, "Task", 2048, (void*)this, 5, NULL); solution that works for me: void MyClass::task(){ while(1){

asyncio and coroutines vs task queues

南笙酒味 提交于 2021-02-06 07:56:51
问题 I've been reading about asyncio module in python 3, and more broadly about coroutines in python, and I can't get what makes asyncio such a great tool. I have the feeling that all you can do with coroutines, you can do it better by using task queues based of the multiprocessing module (celery for example). Are there usecases where coroutines are better than task queues ? 回答1: Not a proper answer, but a list of hints that could not fit into a comment: You are mentioning the multiprocessing

asyncio and coroutines vs task queues

走远了吗. 提交于 2021-02-06 07:55:27
问题 I've been reading about asyncio module in python 3, and more broadly about coroutines in python, and I can't get what makes asyncio such a great tool. I have the feeling that all you can do with coroutines, you can do it better by using task queues based of the multiprocessing module (celery for example). Are there usecases where coroutines are better than task queues ? 回答1: Not a proper answer, but a list of hints that could not fit into a comment: You are mentioning the multiprocessing