Refactoring to Asynchrony?
I program ActionScript for the FlashPlayer. This means compiling a set of ActionScript files into a SWF file (a bunch of bytecode that gets executed by the FlashPlayer in your browser). Anything that is not compiled into the SWF file must be requested. Examples of this would include ANY textual content, media, or graphical content that wasn't originally compiled in. Unfortunately this means dealing with a lot of asynchrony. A double-edged sword since dealing with asynchrony can be a pain in the ass, but can also be a fun force? on your design.
I just want to make the point that ActionScript is single-threaded, but the FlashPlayer is multi-threaded, so things like requesting content over HTTP are done in the background and we are notified of completion via an event broadcasting system (which is built into the language). So the issue here is not a concurrency issue (although I'm interested in any concurrency literature that might be relevant).
When I'm putting toge开发者_StackOverflow社区ther a website I will be adding in functionality a little bit at a time. A little bit at a time usually translates into small steps. And by small step I mean small enough that I don't go from needing content to loading content (e.g. XML using HTTP) in one step. So I'll use, say... Fake It, but at some point I need to implement it for real, hence my search for literature on Refactoring To Asynchrony.
Any thoughts or help would be greatly apprecated. Thanks =)
There is astonishingly beautiful Reactive eXtensions for C# (all .net) and JavaScript.
It has been ported in ActionScript 3 as well and has its own wiki.
From description: raix (Reactive And Interactive eXtensions) is a functional, composable, API for AS3 that simplifies working with data, regardless of whether its interactive (arrays) or reactive (events). raix was previously RxAs
Reactive part of it helps you to build highly asynchronous applications in simple intuitive way.
Hope it will help!
精彩评论