A running example of the code from:
- http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang
- http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html
Small refactorings made to original code:
| {"done": "1"} |
| -- @desc: The fastest, type-agnostic way to copy a Redis key | |
| -- @usage: redis-cli --eval copy_key.lua <source> <dest> , [NX] | |
| local s = KEYS[1] | |
| local d = KEYS[2] | |
| if redis.call("EXISTS", d) == 1 then | |
| if type(ARGV[1]) == "string" and ARGV[1]:upper() == "NX" then | |
| return nil | |
| else |
| RUN apt update | |
| RUN apt upgrade -y | |
| RUN apt install -y apt-utils | |
| RUN a2enmod rewrite | |
| RUN apt install -y libmcrypt-dev | |
| RUN docker-php-ext-install mcrypt | |
| RUN apt install -y libicu-dev | |
| RUN docker-php-ext-install -j$(nproc) intl | |
| RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev | |
| RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ |
A running example of the code from:
Small refactorings made to original code: