Resources on Asynchronous Programming Design Patterns

I am looking for non-trivial resources for asynchronous programming concepts, preferably books, as well as significant articles or articles. This is not about simple examples, such as passing a callback to an event listener in GUI programming or disabling a consumer producer in a queue or writing an onload handler for your HTML (although they are all valid). This is about problems that lighttpd developers may encounter, or someone is making substantial business logic in JavaScript that works in a browser or on node.js. This is about situations where you need to pass a callback to a callback callback ... about complex asynchronous control flows and at the same time remain in your right mind. I am looking for concepts that allow you to do this systematically, talk about this type of control flow, seriously manage a significant amount of logic distributed in deeply nested callbacks, with all the issues of synchronization, synchronization, value binding, passing contexts, etc. .

I would not shy away from some abstract research, such as continuation-passage of style, linear logic, or temporary reasoning. Messages like this seem to be going in the right direction, but discussing specific issues rather than a complete theory (for example, the message mentions a “reactor” pattern that seems relevant without describing it).

Thanks.

EDIT:

To tell you more about the aspects that interest me. I'm interested in a disciplined approach to asynchronous programming, a theory, if you want, maybe just a set of specific templates that I can pass to other programmers and say "This is how we perform asynchronous programming" in non-trivial scripts. I need a theory to unravel layers of callbacks that accidentally don't work or produce false results. I need an approach that allows me to say: "If we do it this way, we can be sure that ...". - Does that make it clear?

EDIT 2:

Since the feedback indicates a dependence on the programming language: it will be JavaScript, but perhaps this is enough to suggest a language that allows you to perform functions of a higher order.

EDIT 3:

The title has been changed to be more specific (although I think design patterns are only one way to look at it, but at least it gives a better direction).

+8
asynchronous
source share
1 answer

When performing multi-layer callbacks, currying is a useful method.

You can find out more about this at http://en.wikibooks.org/wiki/Haskell/Higher-order_functions_and_Currying , and for javascript you can see http://www.svendtofte.com/code/curried_javascript/ .

Basically, if you have several levels of callbacks, and not one massive list of parameters, you can increase it gradually, so that when you are in the loop that calls your function, the various callback functions are already defined and passed.

This does not mean that this is a complete answer to the question, but I was asked to convey this part in response, so I did.

After a quick search, here is a blog where it shows the use of currying with callbacks:

http://bjouhier.wordpress.com/2011/04/04/currying-the-callback-or-the-essence-of-futures/

UPDATE:

After reading the editing of the original question to see the design patterns for asynchronous programming, this may be a good diagram: http://www1.cse.wustl.edu/~schmidt/patterns-ace.html , but there is much more good asynchronous design since first-order functions will simplify this, but if you are using the MPI library and Fortran, then you will have different implementations.

As you approach design, language and related technologies strongly influence that any answer will be incomplete.

+3
source share

All Articles