V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
xianyv
V2EX  ›  问与答

有大佬用过 jellyfin-sdk-kotlin 吗? 其中的 websocket 各种消息是如何触发的?

  •  
  •   xianyv · Apr 12, 2024 · 707 views
    This topic created in 758 days ago, the information mentioned may be changed or developed.

    最近在研究 jellyfin-sdk-kotlin,一直没搞明白 websocket 的各种消息是如何触发的,看 sdk 的支持列表里有 UserUpdateMessage,添加监听并且修改用户信息后,消息一直没有发送过来.

     runBlocking {
        println("Starting subscription")
    
        val connection = apiClient.ws()
        connection.addListener<UserUpdatedMessage>() {
            println("数据监听")
        }
    
        // Listen for messages
        // this automatically subscribes to activity log entries etc.
        connection.addGlobalListener { message ->
            println("Received $message")
        }
    
        awaitCancellation()
    }
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   954 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 154ms · UTC 19:10 · PVG 03:10 · LAX 12:10 · JFK 15:10
    ♥ Do have faith in what you're doing.