Coder Social home page Coder Social logo

Comments (6)

ThaUnknown avatar ThaUnknown commented on June 11, 2024

those are async functions, you simply need to run

await client.add()

and

await client.remove()

from webtorrent.

uriva avatar uriva commented on June 11, 2024

consider the case where add is called from different places in the code. If there is an sync context switch inside add, then we can be inside it twice.

await is not equivalent to a lock.

from webtorrent.

ThaUnknown avatar ThaUnknown commented on June 11, 2024

fair

from webtorrent.

uriva avatar uriva commented on June 11, 2024

while we're at it, these functions should probably not have a cb parameter and be async at the same time.

from webtorrent.

ThaUnknown avatar ThaUnknown commented on June 11, 2024

they should be, but not as a part of this issue

this was planned for ages: https://github.com/orgs/webtorrent/projects/1#card-60702582

they became async because other issues were being blocked by it, and using .then would be useless if it was later re-written to await anyways, and dropping callback based calls for webtorrent, means doing it inside close to 20 packages, which requries a lot of testing and rewriting

from webtorrent.

github-actions avatar github-actions commented on June 11, 2024

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

from webtorrent.

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.