webmcp

view framework/env/execute/_initializers.lua @ 316:a2c733535b8e

Support intervals; Interactive shell requires application name now
author jbe
date Mon Mar 23 16:05:56 2015 +0100 (2015-03-23)
parents 2ddbb44680f7
children beb1e7925a52
line source
1 function execute._initializers(initializer_path_element)
2 local yieldvalue1 = {}
3 local yieldvalue2 = {}
4 local coro = coroutine.wrap(function()
5 execute.multi_wrapped(
6 execute._create_sorted_execution_list(
7 function(add_by_path)
8 add_by_path(initializer_path_element)
9 add_by_path(WEBMCP_APP_NAME, initializer_path_element)
10 end,
11 function(full_path, relative_path)
12 execute.file_path{ file_path = full_path }
13 end
14 ),
15 function()
16 coroutine.yield(yieldvalue1)
17 end
18 )
19 return yieldvalue2
20 end)
21 local yieldvalue = coro()
22 if yieldvalue == yieldvalue2 then
23 error("Initializers failed to call execute.inner()")
24 elseif yieldvalue ~= yieldvalue1 then
25 error("Unexpected yield in initializers")
26 end
27 execute._finalizers[#execute._finalizers+1] = function()
28 assert(coro() == yieldvalue2, "Unexpected yield in finalizers")
29 end
30 end

Impressum / About Us