Oh nice, thanks Thierry.

On Tue, Aug 11, 2015 at 4:14 AM, Thierry FOURNIER
<[email protected]> wrote:
> On Mon, 10 Aug 2015 22:24:43 -0400
> Camilo Lopez <[email protected]> wrote:
>
>> Dearest list,
>>
>> (Although this question is mostly directed to Thierry and Willy)
>>
>> What is the best (or is it even possible) way of manipulating the list
>> of backend servers at runtime using lua ?
>
> Hi Camilo,
>
> You should create a sample-fecth (or converter), and use his result for
> choosing the backend. Example:
>
>
> lua file:
>
>    core.register_fetches("choose_my_backend", function(txn)
>       -- here the choose backend algoritm
>       return "the_choosed_backend"
>    end)
>
> haproxy configuration file:
>
>    frontend name
>       [...]
>       use_backend %[lua.choose_my_backend]
>       [...]
>
> Thierry

Reply via email to