Created
March 18, 2012 05:31
-
-
Save kazupon/2069178 to your computer and use it in GitHub Desktop.
play_script sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var KyotoTycoon = require('kyoto-tycoon').KyotoTycoon; | |
var kt = new KyotoTycoon(); | |
kt.play_script('echo', { key: 'value' }, function (err, data) { | |
if (err) { // error | |
// Somthing todo ... | |
return; | |
} | |
// success | |
// Somthing todo ... | |
console.log('echo result : %j', data); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kt = __kyototycoon__ | |
function debug(msg) | |
kt.log('debug', msg) | |
end | |
function echo(inmap, outmap) | |
for key, value in pairs(inmap) do | |
debug(('key = %s, value = %s'):format(key, value)) | |
outmap[key] = value | |
end | |
return kt.RVSUCCESS | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment