Skip to content

Instantly share code, notes, and snippets.

View vigack's full-sized avatar

vigack

  • Hangzhou. China
View GitHub Profile
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
local redis_c = require "resty.redis"
local ok, new_tab = pcall(require, "table.new")
if not ok or type(new_tab) ~= "function" then
new_tab = function (narr, nrec) return {} end
end
local _M = new_tab(0, 155)
FROM openresty/openresty:alpine
COPY nginx.conf /usr/local/openresty/nginx/conf
COPY test.lua /usr/local/openresty/nginx/test.lua
COPY required.lua /usr/local/openresty/lualib/required.lua