webmcp
diff framework/env/execute/_initializers.lua @ 214:6ac7133bb58e
Work on Moonbridge integration: added execute._initializers(...), new function request.get_param{...}; Code cleanup in mcp.lua and tempstore.save(...)
author | jbe |
---|---|
date | Sat Jan 10 10:44:17 2015 +0100 (2015-01-10) |
parents | |
children | f66037207da8 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/framework/env/execute/_initializers.lua Sat Jan 10 10:44:17 2015 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +function execute._initializers(initializer_path_element) 1.5 + local yieldvalue = {} 1.6 + local coro = coroutine.wrap(function() 1.7 + execute.multi_wrapped( 1.8 + execute._create_sorted_execution_list( 1.9 + function(add_by_path) 1.10 + add_by_path(initializer_path_element) 1.11 + add_by_path(WEBMCP_APP_NAME, initializer_path_element) 1.12 + end, 1.13 + function(full_path, relative_path) 1.14 + execute.file_path{ file_path = full_path } 1.15 + end 1.16 + ), 1.17 + function() 1.18 + coroutine.yield(yieldvalue) 1.19 + end 1.20 + ) 1.21 + return yieldvalue 1.22 + end) 1.23 + local function cont() 1.24 + assert(coro() == yieldvalue, "Unexpected yield") 1.25 + end 1.26 + cont() 1.27 + execute._finalizers[#execute._finalizers+1] = cont 1.28 +end