【发布时间】:2011-09-06 21:14:53
【问题描述】:
假设我有一个用 .XML 文件响应的简单代码。
app.post '/incoming', (req,res) ->
console.log "Hello, incoming call!"
message = req.body.Body
from = req.body.From
sys.log "From: " + from + ", Message: " + message
test = "hello"
r = new Twiml.Response()
r.append(new Twiml.Say('Hello, there!' + test + ' Enter your ATM card PIN'))
console.log(r.toString())
res.send r.toString()
是否有可能如果 2 个请求同时出现,一个会得到错误的响应?我问这个是因为我不完全理解异步是如何工作的,以及这是否正在做我想做的事情。
谢谢
【问题讨论】:
-
@Raynos,实际上我没有。我在这里和那里摸过,但没有什么很复杂的。
标签: javascript node.js coffeescript