in async environments - we do love them - there are times when you need to make sure foo is run after bar in all cases. for our VisualWeb framework we thus developed a object/class called escalator that allows us to write sequential code.
- this code is part of the VisualWeb Project by
- LinkCloud ( http://www.mylinkcloud.com )
- ViSERiON UG (haftungsbeschraenkt) ( http://www.viserion.com )
- K!Lab GmbH ( http://www.klab-berlin.com )
- MIT license.
- AUTHOR: Toni Wagner @itsatony
- escalator offers DELAYS between steps. These are handy to make your app more response during cpu/load intensive code sequences. For example timeouts are a good idea to update upload/downloaf/progress bars
- escalator offers setting of code-SCOPE PER STEP, thus enabling you to control the memory environment your steps are run in.
- escalator offers a CONSTANT NAMESPACE, actually its own namespace, which is made available (passed as an additional call parameter) to every step. Thus, exchange of data between steps is super-easy and straightforward.
- escalator objects can PERSIST with fully running and debugging info if you want that.
- escalator offers a debug/logging mode that will record the time each step takes. very handy for performance optimization and error tracing
- escalator wraps each step-call into a try-catch and allows you to define the errorhandler.
- escalator steps can control the flow of efficiently, even stop the complete escalator with a message.
- dependencies were removed ... this is totally independent now .
- none yet ;(
- v0.2.8 added onError checking and upon catchError onError will be called. if not there the escalator finishes.
- v0.2.2 fixes to default add values 18.12.2013
- v0.2.0 initial public release 15.11.2012 - bug fixes - better error handling of steps - optional try-catching of steps (allows for js engines to run optimizations if turned off)
- v0.1.0 initial public release 08.05.2012
- removed dependencies
- enabled using the same file for client- and nodeJS server-side implementation
- 1 - three steps, different configs
var someVar = 'hello';var firstStep =id: 'myFirstStep'priority: 10someVar = 'hello too'next;;var secondStep =id: 'mySecondStep'priority: 20delay: 10parameters: someVarscope: thisconsole.logsomethingWePassedIn;thisEscalatoranotherVariable = 42;next;;var lastStep =priority: 22console.logthisEscalatoranotherVariable;next;;var myDemoEscalator ='demoEscalator'firstStep secondStep lastStepstart;