We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果一个RPC调用不需要知道它的结果,那么就不应该设置一个回调函数。
但是如果不给RPC调用设置回调函数,则RPC服务器会在接受参数时,将最后一个参数误传为 这里 的函数。
重现案例如下:
self.app.rpc.any.anyRemote.fun(session, somevar, somevar, { "somearg": 1 }); // ... anyRemote.prototype.fun = function(somevar, somevar, lastarg) { // 这里会发现lastarg不是代码上面的最后一个对象,而是pomelo-rpc中的一个函数 };
self.app.rpc.any.anyRemote.fun(session, somevar, somevar, { "somearg": 1 }, function(){}); // ... anyRemote.prototype.fun = function(somevar, somevar, lastarg) { // 这样才可以拿到正确的lastarg };
这是一个设计,还是一个实现缺陷?
The text was updated successfully, but these errors were encountered:
这个是之前的设计问题,rpc必须有回调函数
Sorry, something went wrong.
那这个设计会改变吗?如果不会的话,就关了这个issue吧
可以不带回调函数的pr 已经提交.
No branches or pull requests
如果一个RPC调用不需要知道它的结果,那么就不应该设置一个回调函数。
但是如果不给RPC调用设置回调函数,则RPC服务器会在接受参数时,将最后一个参数误传为 这里 的函数。
重现案例如下:
这是一个设计,还是一个实现缺陷?
The text was updated successfully, but these errors were encountered: