-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.lua
41 lines (33 loc) · 1.01 KB
/
app.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
local clock = require "clock"
local fiber = require "fiber"
local log = require "log"
local ffi = require "ffi"
local json = require "json".new()
local centrifuge = require "centrifuge"
--=======================================================================================
-- Rotor: Tarantool Engine for Centrifugo/Centrifuge based on Tarantool Cartridge.
-- Provides PUB/SUB broker, ephemeral history streams and channel presence functionality.
--=======================================================================================
local app = {}
app.init = function(opts)
if not opts then
opts = {}
end
if opts.is_master == true then
centrifuge.init_spaces()
end
centrifuge.start()
rawset(_G, "centrifuge", centrifuge)
end
function app.stop()
centrifuge.stop()
rawset(_G, "centrifuge", nil)
end
function app.validate_config(_, _) --(conf, old)
return true
end
function app.apply_config(_, _) --(conf, opts)
return true
end
app.role_name = "rotor"
return app