Skip to content
New issue

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

怎么实现服务端回调客户端函数 #894

Open
herui-ares opened this issue Aug 25, 2023 · 3 comments
Open

怎么实现服务端回调客户端函数 #894

herui-ares opened this issue Aug 25, 2023 · 3 comments

Comments

@herui-ares
Copy link

如题,只能使用异步掉调用来实现回调功能吗?异步回调的话支持多次响应回调吗?

@ruanshudong
Copy link
Contributor

第一问没懂, 也许你要的是push功能? 可以看看文档
第二问支持

@herui-ares
Copy link
Author

感谢您的回复,我现在需要服务端调用客户端的功能函数,服务端有特定的触发机制,条件满足之后就需要客户端执行对应的功能函数。了解到可以用异步调用来实现客户端函数的回调,但是看官方文档异步调用是单次了,而我需要服务端多次回调客户端函数的能力;也了解到您提到的push功能,可以满足多次回调的要求,但是了解到push功能是在push线程中的run函数里面循环+条件判断去触发,而循环会影响到性能消耗。请问下是否支持我主动push消息,而不需要循环去判断条件。

@ruanshudong
Copy link
Contributor

保存CurrentPtr, 随时可以用这个对象push数据的, 当然前提是连接没有断, 所以current需要定时更新

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants