diff options
author | Christian Pointner <equinox@helsinki.at> | 2011-03-05 22:56:04 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2011-03-05 22:56:04 (GMT) |
commit | af0d500ad1b5a8f1a9d1abc84420313ccd1cf883 (patch) | |
tree | 9a7af409444d3c79dec6998d0023ee0193d0a0d9 /nopsyncd | |
parent | e7caf5ce4e25692842237aea2f14f0c89bb74645 (diff) |
added noprml
added nopsyncd (not yet finished)
Diffstat (limited to 'nopsyncd')
-rwxr-xr-x | nopsyncd/nopsyncd.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/nopsyncd/nopsyncd.lua b/nopsyncd/nopsyncd.lua new file mode 100755 index 0000000..5ac1acb --- /dev/null +++ b/nopsyncd/nopsyncd.lua @@ -0,0 +1,21 @@ +#!/usr/bin/lua + +local queue_name = "/rhnop" + +mq = require "luamq" + +local q, err = mq.create(queue_name, "ro") +if q == nil then + io.stderr:write("creation of message queue failed: " .. err .. "\n") + os.exit(1) +end + +while true do + local msg, prio = mq.receive(q) + if msg == nil then + io.stderr:write("recv error: " .. prio .. "\n") + os.exit(2) + end + + print("received message '" .. msg .. "' with prio: " .. prio) +end |