Code Monkey home page Code Monkey logo

Comments (3)

windreamer avatar windreamer commented on July 20, 2024

I think it is better to let user decide whether to run a particular callback synchronously or asynchronously.
If you decide to run it asynchronously, you can use thead, threadpool, coroutine or anything you like to run it. pymesos neither have the knowledge of the user's need, nor is able to force user to use any kind of these solutions.

And assume, we are now callback in another thread, for example _io_thread. we would also be blocked infinitely, because statusUpdate cannot be called in _io_thread as it is occupied by reconcile_all_running_tasks.

If you aware that the old pymesos (<0.2.0) is using two threads instead of one, the main concern is we should not make IO lagged by slow callback. it is not for blocking issue. In this new version, we decide to simplify our design for better maintainability. and we see 20% performance boost in our production environment. I think it is worthy.

Hope my explanation is helpful.
thx

from pymesos.

yuyang0 avatar yuyang0 commented on July 20, 2024

you are right, running all callback in a new thread can't solve this problem, but this is a trap to the user of this package. this package needs documentation. anyway thx

from pymesos.

windreamer avatar windreamer commented on July 20, 2024

yes, documentation is needed badly.
we will see whether we can spare some time to document this.
thank you for your support during this long time.

from pymesos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.