英文:
How can I connect to websockets in Weavy if I am making my own UI?
问题
Websockets在集成Weavy时特别重要,因为它有助于Weavy环境处理实时通信。文档中提供了与Javascript、Javascript与.Net等相关的UI工具包的参考信息。但如果我要使用文档中未提及的技术创建自己的UI,那么在集成Weavy时如何连接到websockets呢?
我尝试在文档中查找有关如何在自定义UI中连接websockets的信息,但没有找到任何合适的答案或相关的常见问题解答。
英文:
Websockets are particularly important when it comes to integrating Weavy because it helps the Weavy environment in handling realtime communications. In the documentation, there are references given for UI kits related to Javascript, Javascript with .Net, etc. But if I am making my own UI with technologies other than the ones mentioned in the documentation, then what is the way to connect to websockets while integrating Weavy?
I tried finding about connecting websockets with custom UI in the documentation but didn't get any proper answer or any FAQ related to it.
答案1
得分: 2
I'll provide a translation of the text you shared:
"目前还没有开放的 API 可以连接到 Weavy 实时服务器。这是我们将来会创建的东西。但如果你想查看它是如何完成的,例如在 React UI 套件中,你可以查看 WeavyClient 如何连接到实时 hub。
当连接建立后,你需要订阅来自 Weavy 服务器的特定事件。
Subscribe 服务器方法需要一个特定格式的组名。正如我所说,这尚未有文档记录。但作为示例,如果你想监听特定应用程序中创建的消息,你需要使用以下格式:
a[应用程序 ID]:[事件]
示例:
a13:message_created
a 表示这是一个应用程序,数字 13 是应用程序的 ID,message_created 是你想订阅的事件。
这是 React UI Kit 中一个组件的示例:
总结一下... 目前还没有开放的 API。以上所示的内容可能看起来有点复杂,因为它是内部逻辑,不是预期公开的。"
I've provided the translated content as requested.
英文:
At the moment, there is no open api to connect to the Weavy realtime server. This is something that we will create in the future. But if you want to take a look at how it's done, for example in the React UI kit, you can check out how the WeavyClient connects to the realtime hub.
When a connection is established, you have to susbscribe to specific events from the Weavy server.
The Subscribe server method expects a group name which is in a specific format. This is as I said not documented yet. But as an example, if you want to listen to created messages in a specific app, you have to use the format:
a[app id]:[event]
Example:
a13:message_created
The a means it's an app, the number 13 is the id of the app, and message_created is the event you want to subscribe to.
Here is an example from a component in the React UI Kit:
To summarize... No open api yet. It might seem a bit complicated since what I showed above is internal logic and not what is expected to be exposed.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论