cancellation

How to force an ActionBlock to complete fast

痴心易碎 提交于 2020-06-01 07:16:07
问题 According to the documentation: A dataflow block is considered completed when it is not currently processing a message and when it has guaranteed that it will not process any more messages. This behavior is not ideal in my case. I want to be able to cancel the job at any time, but the processing of each individual action takes a long time. So when I cancel the token, the effect is not immediate. I must wait for the currently processed item to complete. I have no way to cancel the actions

vba inputBox: How to tell difference between “cancel” and “OK” with an empty textbox

北城余情 提交于 2020-04-18 05:02:03
问题 A vba inputBox returns an empty string when the cancel button is pressed. When OK is pressed, it returns whatever text is in its textbox. The inputBox's third positional argument is the initial text in its textbox. The default value for this argument is "". In my application, I use an inputBox to ask a user to specify the name for a new record when he clicks an "Add Record" button. If he presses "cancel", no problem: seems he changed his mind about that new record. I exit the sub. However, if

vba inputBox: How to tell difference between “cancel” and “OK” with an empty textbox

风流意气都作罢 提交于 2020-04-18 05:01:06
问题 A vba inputBox returns an empty string when the cancel button is pressed. When OK is pressed, it returns whatever text is in its textbox. The inputBox's third positional argument is the initial text in its textbox. The default value for this argument is "". In my application, I use an inputBox to ask a user to specify the name for a new record when he clicks an "Add Record" button. If he presses "cancel", no problem: seems he changed his mind about that new record. I exit the sub. However, if

Any way to differentiate Cancel and Timeout

不想你离开。 提交于 2020-03-13 04:29:10
问题 I have some code that is validating some data by making calls to a number of other services. I start all of the calls in parallel and then wait until at least one of them finishes. If any of the requests fail, I don't care about the result of the other calls. I make the calls with HttpClient and I have passed an HttpMessageHandler in that does a bunch of logging. Essentially: protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken

Any way to differentiate Cancel and Timeout

眉间皱痕 提交于 2020-03-13 04:27:50
问题 I have some code that is validating some data by making calls to a number of other services. I start all of the calls in parallel and then wait until at least one of them finishes. If any of the requests fail, I don't care about the result of the other calls. I make the calls with HttpClient and I have passed an HttpMessageHandler in that does a bunch of logging. Essentially: protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken

Any way to differentiate Cancel and Timeout

血红的双手。 提交于 2020-03-13 04:27:44
问题 I have some code that is validating some data by making calls to a number of other services. I start all of the calls in parallel and then wait until at least one of them finishes. If any of the requests fail, I don't care about the result of the other calls. I make the calls with HttpClient and I have passed an HttpMessageHandler in that does a bunch of logging. Essentially: protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken

Using Android's build-in acoustic echo cancellation

好久不见. 提交于 2020-01-10 19:31:30
问题 Does anyone know how to use Android device's built-in acoustic echo cancellation? It is located somewhere in silicon and is used for GSM/CDMA speakerphone calls. We'd really like to tap into it for a VoIP application instead of rolling our own. Ben 回答1: I was finally able to get echo cancellation to work on my Arm5 (WM8650) processor (Android 2.2). Below are the steps I took. I wrapped Speex with JNI and called echo processing routines before sending PCM frames to encoder. No echo was

Using Android's build-in acoustic echo cancellation

可紊 提交于 2020-01-10 19:31:05
问题 Does anyone know how to use Android device's built-in acoustic echo cancellation? It is located somewhere in silicon and is used for GSM/CDMA speakerphone calls. We'd really like to tap into it for a VoIP application instead of rolling our own. Ben 回答1: I was finally able to get echo cancellation to work on my Arm5 (WM8650) processor (Android 2.2). Below are the steps I took. I wrapped Speex with JNI and called echo processing routines before sending PCM frames to encoder. No echo was

promise cancellation still firing fulfill function

筅森魡賤 提交于 2020-01-04 16:03:13
问题 This is my code: var promiseResult = new BBpromise(function(resolve, reject){ console.log(1) // some actions setTimeout(function(){ resolve(); }, 2000); }).cancellable().catch(BBpromise.CancellationError, function(e){ console.log(e); }); promiseResult.then(function(){ console.log('AYYYY'); }); promiseResult.cancel(new BBpromise.CancellationError()).then(function(s){ console.log('canceled ?'); }); And I'm getting the following output: BTW.. the output seems to be immediate. Seems like if just