MitchBarnett / wiki-bank-tag-integration

Allows the creation of bank tags from categories on the offical OSRS wiki
BSD 2-Clause "Simplified" License
9 stars 13 forks source link

Executing commands freezes game #4

Open while-loop opened 4 years ago

while-loop commented 4 years ago

The wiki api call is done on the client thread so the game freezes until the request is finished.

I think you could move the request to a new thread or call

RuneLiteAPI.CLIENT.newCall(request).enqueue(new Callback.....);

instead of

RuneLiteAPI.CLIENT.newCall(request).execute();

https://www.baeldung.com/guide-to-okhttp#asynchronous-get-with-okhttp

MitchBarnett commented 4 years ago

Yes I am aware of this and did plan to make it async I just never got around to it.

It is only a minor inconvenience as the queries should be quick and I don't think anyone will be running the commands during a time critical activity however, it will be fixed if I push another update.

while-loop commented 4 years ago

Right on! It's not a major issue for me either.

Thanks for the cool plugin 😁