Skip to content

Instantly share code, notes, and snippets.

View aleclarson's full-sized avatar

Alec Larson aleclarson

View GitHub Profile
@aleclarson
aleclarson / tarantool-websockets.lua
Created February 15, 2018 13:30 — forked from daurnimator/tarantool-websockets.lua
Tarantool + lua-http websockets nonblocking
#!/usr/bin/env tarantool
local cqueues = require "cqueues"
local fiber = require "fiber"
local socket = require "socket"
package.loaded["http.client"] = nil -- tarantool has a namespace clash
local websocket = require "http.websocket"
local cq = cqueues.new()
-- Hook up cqueues loop inside tarantool fiber