Task Abstraction for XPath Derived Languages
summary
A portable XPath-level function library called EXPath Tasks wraps side-effecting operations as deferred tasks (maps of functions) that thread a real world state through a composed chain, forcing safe ordering while enabling concurrency. Implementations exist in pure XQuery, XSLT, Java (eXistDB) and Saxon-JS (JavaScript event loop) and provide run-on-safe to execute the chain plus a lift to async primitive; demos work but adopting it requires restructuring applications.
AI-written summary · about
chapters (4)
- 0:00Start
- 6:54Task-based cake recipe Replace standard recipe of sequential steps: • Wrap each instruction as a task • Explicitly describe how these are composed • Explicitly allow concurrent or asynchronous processing
- 13:43How Tasks work A Task is a state transformation function - Performs your action upon a special RealWorld object Is a pure function and is safe !
- 20:21Asynchronous tasks Function to construct an asynchronous task • taskasync($task) - constructs an asynchronous task from an existing task When an asynchronous task is executed, it returns an Async- a function which represents the asynchronous process, not the result of that process.
