Deleted

Discussion in 'Spigot Plugin Development' started by Simo389, May 22, 2015.

  1. Deleted.
     
    #1 Simo389, May 22, 2015
    Last edited: Oct 12, 2018
  2. Well, I always thought this event was actually called asynchronously, therefore the name... Sure it isn't?
     
  3. JamesJ

    Supporter

    AsyncChatEvent's are called in an Async thread (a thread that's not the main thread).
     
  4. It can 'come back' to the main thread and tax the main thread if you're calling methods that run on the main thread. It depends on what you're doing in the listener.

    Also something worth mentioning is that the documentation states:
    This event will sometimes fire synchronously, depending on how it was triggered.

    But it seems that's only when a plugin causes the event to fire.
     
  5. wat

    methods have no context of what thread they're in. If you call a method it won't magically execute on a different thread.
     
    • Agree Agree x 1
  6. If the event is running on the main thread and you call methods in it, it will run on the main thread. Just because it has async in the name doesn't mean it will always be async.
     
  7. It could very well be, because PlayerChatEvent fires on the main thread 100% of the time...
     
  8. Yes, that's a given.