pool
pool copied to clipboard
[hook.rb]cache WebAPI instance
Improve the speed of processing request in hook.rb
For example,
docker/pool/provisioning/mruby.conf:
<IfModule mruby_module>
ProxyPreserveHost On
mrubyChildInitMiddle "/app/handlers/init.rb"
mrubyTranslateNameMiddle "/app/handlers/hook.rb"
</IfModule>
docker/pool/handler/init.rb:
Userdata.new("api").git_api = WebAPI.new("http://0.0.0.0:9000")
Userdata.new("api").docker_api = WebAPI.new("http://0.0.0.0:9002")
docker/pool/handler/hook.rb:
...
# To request and control git repository inside pool, init the api client
# Git repository handler(GitHandler) listens on "http://0.0.0.0:9000"
git_api = Userdata.new("api").git_api
...