1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Questions about AsyncTask.

Discussion in 'Development' started by moska, Apr 25, 2017.

  1. moska

    moska Baby Zombie

    Messages:
    105
    GitHub:
    supermaxalex
    I wanted to know what is the REAL utility and all possibilities we can do with the AsyncTask, and how to use it correctly ?
    Thanks !
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    SOFe likes this.
  3. moska

    moska Baby Zombie

    Messages:
    105
    GitHub:
    supermaxalex
    Oh my god, that's so hard to understand and to do it .-.
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Last edited by a moderator: Apr 25, 2017
  5. moska

    moska Baby Zombie

    Messages:
    105
    GitHub:
    supermaxalex
    I readed everything, and I still doesn't understand.
     
  6. Miste

    Miste Baby Zombie

    Messages:
    109
    GitHub:
    Misteboss
    Same ;-;
     
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    And nobody can help you if you don't point out which part of it you don't understand. Otherwise all that we can tell you is the same thing.
     
    jasonwynn10 and Thunder33345 like this.
  8. Miste

    Miste Baby Zombie

    Messages:
    109
    GitHub:
    Misteboss
    For me it's How to construct it, the difference between onRun et onCompletion and what i can't do in
     
  9. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    For how to construct an AsyncTask, it is a question of PHP knowledge, which is not related to this forum. Look at the PHP documentation if you need help with constructing objects in PHP.
    For the difference between onRun and onCompletion, onRun() is the bulk operation (cooking the food) that should be executed in worker threads, while onCompletion() is the operation executed in the main thread that handles the result of the bulk operation (serving the food to the customer).
     
    Last edited: May 1, 2017
    HimbeersaftLP likes this.
  10. moska

    moska Baby Zombie

    Messages:
    105
    GitHub:
    supermaxalex
    Actually, I know what this is can do now, but to construct, it still hard for me.
    onRun() -> Just PHP, not PM API
    onCompletion() -> PM API can be used
     
  11. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Define "PM API" well. In fact, a lot of the PocketMine API do not reference the Server god object and can be used freely. Methods in AsyncTask, e.g. publishProgress(), setResult(), can still be used.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.