summaryrefslogtreecommitdiff
path: root/server-beta/src/pub/report.lua
blob: edd3ee0ea2fb316dea78d2f7c469ff1568a1e4b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local pub   = require 'pub.pub'
local await = require 'await'

pub.on('log', function (params, brave)
    log.raw(brave.id, params.level, params.msg, params.src, params.line)
end)

pub.on('mem', function (count, brave)
    brave.memory = count
end)

pub.on('proto', function (params)
    local proto = require 'proto'
    await.create(function ()
        if params.method then
            proto.doMethod(params)
        else
            proto.doResponse(params)
        end
    end)
end)