MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    关于java事件监听设置优先级问题

    开发交流
    2
    3
    87
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Moyuyanli
      Moyuyanli last edited by Moyuyanli

      问题:我在java中尝试更改事件监听的优先级,但是有一个参数我不会填,摸底发现是kt的东西,由于没有学过kt,导致我没办法实现该功能。

      不知道为啥我这里抽风了,上传不了图片了

      监听器调度
      监听器会被创建一个协程任务, 语义上在 [parentScope] 下运行.
      通过 Kotlin [默认协程调度器][Dispatchers.Default] 在固定的全局共享线程池里执行, 除非有 [coroutineContext] 指定.

      就是这个参数

      @param coroutineContext 在 [defaultCoroutineContext] 的基础上, 给事件监听协程的额外的 [CoroutineContext].

      期望:给一个参数的填写方法,或者指明一条路。

      1 Reply Last reply Reply Quote 0
      • Topic is now a regular thread  Moyuyanli Moyuyanli 
      • Karlatemp
        Karlatemp last edited by

        EmptyCoroutineContext.INSTANCE, 你应该看看那的默认参数是什么

        Moyuyanli 1 Reply Last reply Reply Quote 1
        • Moyuyanli
          Moyuyanli @Karlatemp last edited by

          @Karlatemp 好的,我现在知道了,谢谢大佬

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact