Quantcast
Channel: Serverphorums.com
Viewing all articles
Browse latest Browse all 23908

HAProxy/Lua survey about lua configuration form

$
0
0
Hi list,

Actually we two Lua registration forms:

The style of fetches and converters (and coming soon the "services").
With this registering style, the Lua developer register the function in
the haproxy core like this:

core.register_fetch("fetch-name", function(...)
... code ...
end)

In the HAProxy configuration file, the registered Lua fetch can be used
like other fetch. it is automatically prefixed by "lua.". For example:

use-backend service if { lua.fetch-name }

The second mode is used with actions. Each action doesn't require any
registration. The user just give the Lua function name in the ha proxy
configuration. For example, in Lua file:

function my_action(...)
... code ...
end

And the associated HAProxy file:

http-request lua my_action

I want to remove the second declaration mode. After this the actions
will be registered like fetches and converters. The previous example
should become:

core.register_action("action-name", function(...)
... code ...
end)

And

http-request lua.action-name

I think that this mode of registration facilitates the distribution of
Lua scripts for HAProxy. The administrator doesn't look into the file
bout any function name, and the administrator cannot call a function
which is not designed for running in an HAProxy action.

My problem, is that the second configuration mode exists in HAProxy
from a long time. I don't want to remove it without a consultation of
the people who already use this feature. My other problem, is that if
the version 1.6 is released with the second mode, we will keep (and
maintain) for a long time :)

the discussion is open, please give me your opinions.

Thierry

Viewing all articles
Browse latest Browse all 23908

Trending Articles