Tags "asynchronous" Result

Asynchronous methods and asynchronous delegates

C# 3.0 in a nutshell says asynchronous methods and asynchronous delegates looks similar but the behavior is very different. Here is what the book says about both. Asynchronous methods Rarely or never blocks any thread. Begin method may not immediately return to the caller. An agreed protocol with no C# language support. Asynchronous delegate

it1352 1 2019-05-06

Javascript asynchronous

I have some 3 methods. login(); isLogin(); reply(); function isLogin(){ FB.getLoginStatus(function(response) { if (response.session) { // logged in and connected user, someone you know } else { // no user session available, someone you dont know } }); } function login (){ FB.login(function(response) { if

it1352 0 2020-11-03

Asynchronous Thread.Sleep()

I want to put a delay between 2 operations without keeping busy the thread workA(); Thread.Sleep(1000); workB(); The thread must exit after workA and execute workB (maybe in a new thread) after some delay. I wonder if it's possible some equevalent of this pseudocode workA(); Thread.BeginSleep(1000, workB); // callback edit My program is i

it1352 0 2019-05-06

Asynchronous Logging

Right now in my application,at certain points we are logging some heavy stuff into the log files. Basically only for logging we are creating JSON of the data available and then logging into Log files.This is business requirement to log data in JSON format . Now creating JSON from the data available and then logging to FILE takes lot of time and i

it1352 2 2019-05-08

Asynchronous Programming

I''m trying to determine if I need to make my application multi-threaded, or if it can be done with asynchronous programming. I realize that asynch calls do create a new thread in the background, but when they come back, they return to the thread that launched them, is that correct? If I go multi-threaded, then I just need to spawn a new thread for

it1352 1 2019-06-25

Asynchronous constructor

How can I best handle a situation like the following? I have a constructor that takes a while to complete. var Element = function Element(name){ this.name = name; this.nucleus = {}; this.load_nucleus(name); // This might take a second. } var oxygen = new Element('oxygen'); console.log(oxygen.nucleus); // Returns {}, because load_nucle

it1352 1 2019-05-08

Asynchronous Iterator

I have the following code: while(slowIterator.hasNext()) { performLengthTask(slowIterator.next()); } Because both iterator and task are slow it makes sense to put those into separate threads. Here is a quick and dirty attempt for an Iterator wrapper: class AsyncIterator<T> implements Iterator<T> { private final BlockingQueue&l

it1352 4 2019-05-08

Asynchronous ReadDirectoryChangesW()?

I want to monitor the modifications in a specified directory, and retrieve the exact change information. So I've decided to use the ReadDirectoryChangesW() function. But I want to use it asynchronously, which means I don't want my worker thread to be blocked if there are no changes in the directory. How can I do this? Solution I tend to use ReadDi

it1352 1 2020-09-13

Async/Parallel Combined

I have seen some examples of combining async with parallel in F#. Here's an MSDN sample: http://msdn.microsoft.com/en-us/library/dd233250(v=vs.120).aspx Isn't that an inefficient use of threads? Why would you want to use new threads for many, potentially long running, IO type operations. Isn't that basically creating threads that will just sit ther

it1352 0 2020-11-03