Can someone check that this is safe (Async task)

Discussion in 'Plugin Development' started by acecheesecr14, Mar 8, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    acecheesecr14

    http://pastebin.com/1sJhtu7U That is the class that is handling the task.
    Here is the thing when it's called.

    Code:java
    1. th = new ThreadHandle(this, username, password, API_KEY, pingTime);
    2. th.init();
    3. if(th.getTaskID() == -1){
    4. getLogger().severe("INIT OF THE TASK FAILED. DISABLING PLUGIN.");
    5. getServer().getPluginManager().disablePlugin(this);
    6. }


    *Bumps*

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  2. Offline

    amhokies

    acecheesecr14
    Don't bump a post that you posted 18 minutes ago...
     
    Someone_Like_You likes this.
  3. Offline

    acecheesecr14

    Sorry mr. Admin, It has 2 Views xD I don't want to deploy this and it be unstable...

    Bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  4. Offline

    Space_BR

     
  5. Offline

    CraftThatBlock

    You should be running it sync, but try it out async, see if it works fine.
     
  6. Offline

    amhokies

    This is bad advice for when it comes to concurrency in any applications. In most cases, it will work fine in testing, but the real problems will begin cropping up later, when people are using it.
     
    acecheesecr14 likes this.
  7. Offline

    acecheesecr14

    I really don't want to deploy it for a load of emails, comments, and complaints saying it's unstable...
     
Thread Status:
Not open for further replies.

Share This Page