lua-resty-core icon indicating copy to clipboard operation
lua-resty-core copied to clipboard

Balancer by lua stream

Open splitice opened this issue 9 years ago • 7 comments

Commits in this branch correspond to the changes for Balancer by LUA in the Stream Subsystem ( https://github.com/openresty/stream-lua-nginx-module/pull/7).

I have renambe the balancer.lua to balancer_http, and created the new implementation as balancer_stream.lua.

I will create a balancer.lua compatibility wrapper once the subsystem check is implemented.

Feel free to adjust the API to match your desired layout.

splitice avatar Feb 04 '16 23:02 splitice

@splitice Just a side note: I think the ngx.semaphore API can be ported over to the stream subsystem in a similar way :)

agentzh avatar Feb 04 '16 23:02 agentzh

Currently I have no use for the semaphore module so wont be doing it myself at this stage.

I ported this because of the lack of variable support in the stream subsystem preventing me from doing something as simple as proxy_pass $map_variable;.

If you have any comments on any of the PR's I've made feel free to let me know today. I am spending the day porting over a couple more of our small patches to the stream subsystem so its not out of my way.

splitice avatar Feb 04 '16 23:02 splitice

@splitice Will you add a test file for using ngx.balancer in the stream subsystem here? (By porting the existing t/balancer.t file to t/balancer-stream.t, for example.)

agentzh avatar Feb 04 '16 23:02 agentzh

Probably best you do. I can do a theoretical port but dont have the time to get the environment passing.

splitice avatar Feb 04 '16 23:02 splitice

Also might be best to check if the balancer_by_lua_* tests all pass first :)

splitice avatar Feb 04 '16 23:02 splitice

@splitice Please check out this tutorial for how to run the tests on your side:

https://openresty.gitbooks.io/programming-openresty/content/testing/

It should be easy :)

agentzh avatar Feb 05 '16 00:02 agentzh

This branch needs to rebase to the latest git master before it can be merged.

agentzh avatar Jul 20 '16 16:07 agentzh