Flex 多服务调用问题
我尝试使用 for 循环调用服务,似乎只有第一个服务调用有效。我的猜测是,一旦调用服务,它就需要等待结果事件,直到可以再次调用它。我该如何解决这个问题?
等待每个服务完成后再查询另一个服务太慢了。
前任。
呼叫响应者 ID =“测试” 通过 Flash Builder 4 正确导入 SomeService
for (var i:int=0;i< pool.length;i++) { test.token = SomeService.getSomething(pool[i].someValue); 只有
一个会成功。帮助!我不想在结果事件后打电话!
I tried to call a service using a for loop and it seems that only the first service call seems to work. My guess is that once a service is called it needs to wait until result event until it can be called again. How can I workaround this?
Waiting for each service to complete before querying for another is too slow.
Ex.
callresponder id="test"
SomeService properly imported through Flash Builder 4
for (var i:int=0;i< pool.length;i++)
{
test.token = SomeService.getSomething(pool[i].someValue);
}
Only one would be successful. Help! I don't want to call after result event!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题:问题是一个呼叫响应程序无法被多个服务呼叫使用。
解决方案:创建更多呼叫响应程序...
var c:CallResponder;
在每次迭代开始之前
c = new CallResponder();
c.addEventListener(ResultEvent.RESULT, resultHandler);
c.token = SomeService.whatEver(某事);
Problem: The problem is one call responder cannot be used by multiple service call.
Solution: Make more call responders....
var c:CallResponder;
before each iteration begins
c = new CallResponder();
c.addEventListener(ResultEvent.RESULT, resultHandler);
c.token = SomeService.whatEver(something);