AsyncPlayerChatEvent & Player.sendMessage thread safe

Discussion in 'Spigot Plugin Development' started by wafwot, Jan 18, 2014.

  1. I didn't bother asking on Bukkit because I don't want an eight year old answer and virtually no one knowledgeable seems to read things any more on there.

    Is AsyncPlayerChatEvent only called by a single thread, or is there a chance that the method will be entered more than once simultaneously?

    Next, is Player.sendMessage thread safe? md_5 stated such but that was a long while ago and all "lists" on the wiki regarding thread safe methods have been removed and essentially replaced with "do nothing" type of warnings.
     
  2. Thinkofdeath

    Developer

    It can be called on multiple threads at once

    Yes it is thread safe but nothing's stopping bukkit from changing that in the future
     
    • Agree Agree x 2
    • Like Like x 1
  3. I know this is a resurrection of sorts, but I just stumbled across my own thread and noticed I never thanked you. I read the answer from an airport on my phone and meant to leave a thanks when I landed, obviously I never did.

    So, two and a half months late, thanks a lot for the concise answers to my questions.
     
    • Optimistic Optimistic x 1