#!/usr/bin/lua

local sio = require "luxio.simple"
local mq = require "luxio.mq"

h = mq.open("/luxio-mq", "r", sio.tomode "0777")

print(h)

while true do
	local msg = assert(h:pull())
	for k, v in pairs(msg) do
		print(k, v)
	end

	if msg.die then
		h:close()
		mq.unlink "/luxio-mq"
		os.exit()
	end
end

