Closed ElvinEfendi closed 5 years ago
@doujiang24 thanks for quick review! I addressed your comments.
Is there anything else I can do to get this merged and released?
@doujiang24 any plan here?
@doujiang24 when are you planning on releasing this?
@ElvinEfendi yeah, just kicked a new release: https://github.com/openresty/lua-resty-balancer/releases/tag/v0.03. thanks for your contribution :)
@doujiang24 thanks! Does it get automatically published to Luarocks? Or do you suggest using OPM?
Does it get automatically published to Luarocks?
not yet.
Or do you suggest using OPM?
OPM doesn't support this library yet since it only supports pure Lua library now.
It's sometimes useful to have Round Robin algorithm to start with a random node in the given list instead of always starting with the first one. Imagine you have 50 replicas on Nginx and in each replica 16 workers. That means all 50*16 requests will end up in the first server.
For another real world use case please refer to the thread in https://github.com/kubernetes/ingress-nginx/issues/4023#issuecomment-495951693.
This PR adds an optional flag to Round Robin initializer and if the flag is set it picks
last_id
at random instead of setting it to `nil.