summaryrefslogtreecommitdiff
path: root/server-beta/src/service.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/service.lua')
-rw-r--r--server-beta/src/service.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/server-beta/src/service.lua b/server-beta/src/service.lua
index 06e2de51..0aaf5a23 100644
--- a/server-beta/src/service.lua
+++ b/server-beta/src/service.lua
@@ -1,11 +1,28 @@
-local client = require 'pub.client'
-local thread = require 'bee.thread'
+local client = require 'pub.client'
+local subprocess = require 'bee.subprocess'
+local thread = require 'bee.thread'
+local task = require 'task'
+local utility = require 'utility'
local m = {}
m.type = 'service'
+function m:listenProto()
+ subprocess.filemode(io.stdin, 'b')
+ subprocess.filemode(io.stdout, 'b')
+ io.stdin:setvbuf 'no'
+ io.stdout:setvbuf 'no'
+ coroutine.wrap(function ()
+ while true do
+ local proto = client:task('loadProto')
+ log.debug('proto:', utility.dump(proto))
+ end
+ end)
+end
+
function m:start()
client:recruitBraves(4)
+ self:listenProto()
end
return m