Skip to content

能否给TLVMessage类型的请求实现类似HttpChunkClient或者WFRedisSubscribeTask机制,实现一次订阅后可以持续收到后续推送结果 #1802

Open

Description

@povs2012
No description provided.

Activity

  1. Barenboim commented on Dec 25, 2025

    @Barenboim
    Contributor

    就是希望请求是一条TLVMessage,回复是持续的TLVMessage流对吧?然后每收到一个TLVMessage会callback一下?

  2. Barenboim commented on Dec 25, 2025

    @Barenboim
    Contributor

    这个client好做,但用workflow实现这样的server不是很自然。

  3. povs2012 commented on Dec 25, 2025

    @povs2012
    Author

    是的,就是sse的自定义协议版

  4. povs2012 commented on Dec 25, 2025

    @povs2012
    Author

    这个client好做,但用workflow实现这样的server不是很自然。

    服务端没问题,之前参考过一些issue,已经实现了类似的功能了

  5. povs2012 commented on Dec 25, 2025

    @povs2012
    Author

    或者说如果客户端和服务端都是workflow,客户端持续的定时使用tlv协议请求服务端(几十毫秒一次),相比订阅一次,持续接收TLVMessage流,性能和对服务端的压力会差别很大吗

  6. Barenboim commented on Dec 25, 2025

    @Barenboim
    Contributor

    区别不会太大吧,一条TLV请求也不消耗多少资源。如果对实时性要求不高,定期请求一下不会多占多少资源。

    workflow最推荐的用法是actor模式,client端也开一个server,实际server端产生消息时,向client端的server发生request。这个方式用workflow实现非常非常自然且高效。

    client订阅,server推送的方式也是可以的,自己实现的话就模仿http chunked client的方式,派生几个类。

  7. povs2012 commented on Dec 25, 2025

    @povs2012
    Author

    看到一个WFRedisServer,这个是不是可以实现redis server,能不能用这个实现个redis的pub sub协议,然后用WFRedisSubscriber来订阅,这样是不是比自己实现TLV协议的chunked client要简单一点

  8. povs2012 commented on Dec 25, 2025

    @povs2012
    Author

    actor模式的话,如果客户端停掉了,服务端怎么知道呢

  9. povs2012 commented on Dec 25, 2025

    @povs2012
    Author

    感觉最好能官方支持持续订阅的TLVMessage,这样方便应用自己定制协议

  10. Barenboim commented on Dec 25, 2025

    @Barenboim
    Contributor
  11. Barenboim commented on Dec 25, 2025

    @Barenboim
    Contributor

    actor模式的话,如果客户端停掉了,服务端怎么知道呢

    request时失败,就知道client挂了。在后端服务里,双向调用是最简洁的模式。但如果有NAT或防火墙就不行了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions