webmcp

changeset 204:b059efd81649

Moonbridge invocation in framework/bin/mcp.lua
author jbe
date Fri Jan 09 04:54:50 2015 +0100 (2015-01-09)
parents c6ef9991b911
children 48ee8826efbe
files framework/bin/mcp.lua
line diff
     1.1 --- a/framework/bin/mcp.lua	Fri Jan 09 01:57:20 2015 +0100
     1.2 +++ b/framework/bin/mcp.lua	Fri Jan 09 04:54:50 2015 +0100
     1.3 @@ -185,7 +185,33 @@
     1.4    return
     1.5  end
     1.6  
     1.7 --- TODO: moonbridge support below this line and in env/request and env/slot
     1.8 +-- invoke moonbridge
     1.9 +local moonbridge_listen = listen
    1.10 +local listeners
    1.11 +function _G.listen(args)
    1.12 +  listeners[#listeners+1] = args
    1.13 +end
    1.14 +for i = 1, #extraargs/2 do
    1.15 +  local config = {}
    1.16 +  local function prepare_globals()
    1.17 +    _G.WEBMCP_APP_NAME = extraargs[2*i-1]
    1.18 +    _G.WEBMCP_CONFIG_NAME = extraargs[2*i]
    1.19 +    _G.config = config
    1.20 +  end
    1.21 +  prepare_globals()
    1.22 +  listeners = {}
    1.23 +  execute.config(config_name)
    1.24 +  for i, listener in ipairs(listeners) do
    1.25 +    function listener.prepare()
    1.26 +      prepare_globals()
    1.27 +      request.execute_preparers()
    1.28 +    end
    1.29 +    listener.connect = request.connect
    1.30 +    listener.finish = request.execute_finishers
    1.31 +  end
    1.32 +end
    1.33 +
    1.34 +--[[ TODO: following lines to be moved to request.connect(...)
    1.35  
    1.36  local success, error_info = xpcall(
    1.37    function()
    1.38 @@ -417,4 +443,5 @@
    1.39    end
    1.40  end
    1.41  
    1.42 -exit()
    1.43 +--]]
    1.44 +

Impressum / About Us