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

Async

Discussion in 'Development' started by Hipster, Nov 4, 2017.

  1. Hipster

    Hipster Zombie

    Messages:
    214
    should we do everything async? commands? teleporting? events? or only internet stuff?
     
  2. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    No, no, no, no.

    First of all, I'd like to bust the rumors that asynchronous is faster. There's no point whatsoever to do everything async because it isn't faster.

    Secondly, if everything is async, nothing I'd async because there is no main thread. So that's just nonsense.

    Thirdly, you don't execute code asynchronously because it's faster, but because a part of code takes a very long time to complete. Think of huge loops, queries and similar.

    Apart from those points, doing loads of things asynchronously is also a pain for plugin developers.
     
    jasonwynn10 likes this.
  3. Pab45O

    Pab45O Spider Jockey

    Messages:
    37
    GitHub:
    Pab450
    No.

    This class can Execute asynchronous tasks in the background.
    It can fork a parallel process and call a function of the class that will execute the task code.
    The parallel task can take given parameters from the originating process. Property values may also be shared with the parallel task using shared memory.

    https://dmamontov.github.io/asynctask/package-asynctask.html
     
  4. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Note that that link is not the Pocketmine implementation. The Pocketmine implementation is based on workers from pthreads, which execute tasks asynchronously.
     
  5. Hipster

    Hipster Zombie

    Messages:
    214
    So how do i decrease server load? 80 player's can't even play survival without making the server(pocketmine) lag while lifeboat etc handler thousands of players... howww?
     
  6. Pab45O

    Pab45O Spider Jockey

    Messages:
    37
    GitHub:
    Pab450
    use multiple servers, optimize your plugins!
     
  7. Hipster

    Hipster Zombie

    Messages:
    214
    i use sqlite3
     
  8. Pab45O

    Pab45O Spider Jockey

    Messages:
    37
    GitHub:
    Pab450
    and?
     
  9. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Lifeboat uses Steadfast 2, a stripped version of Pocketmine where everything they didn't need is removed. Which is a lot. Secondly, Lifeboat has Loads of servers, not just one. SQLite won't magically make your server fast or something, lifeboat just shares a database like MySQL for all servers.
     
    jasonwynn10 and LewBr like this.
  10. Hipster

    Hipster Zombie

    Messages:
    214
    i can't transfer data between servers
     
  11. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Then work on other things that make your server lag. You can use timings (/timings on, /timings paste) to check the cause of these.
     
    jasonwynn10 and Pab45O like this.
  12. Hipster

    Hipster Zombie

    Messages:
    214
    Full server tick, Player network send, player network receive, player order chunks, player send chunks, tick entity, entityMove also timings.pmmp.io doesn't work says 403 forbidden nginx/1.11.12, i used ubuntu one for this
     
  13. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    I use MySQL database to transfer datas and options/preferences of the player i recommend to use that and create multiple servers this can reduce lag too of your network.
     
    MasterPE likes this.
  14. Hipster

    Hipster Zombie

    Messages:
    214
    Yea well i didn't know about it back then so now i'm stuck
     
    MasterPE likes this.
  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.