Comments (6)
those are async functions, you simply need to run
await client.add()
and
await client.remove()
from webtorrent.
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.
fair
from webtorrent.
while we're at it, these functions should probably not have a cb parameter and be async at the same time.
from webtorrent.
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.
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)
- support add more tracker api
- Torrent Downloading On Broweser but not streaming HOT 2
- [Vite] Build failed: No matching export HOT 6
- How to use webtorrent to implement distributed caching of static resources in Service Worker, so as to improve the access efficiency of static resources
- High availability of servers HOT 1
- uncaught type error: file appendTo is not a function. HOT 2
- Want to ADD CODE_OF_CONDUCT.md file HOT 3
- import doesn't work from typescript project HOT 1
- Web Socket Connection Fails: Video is loading indefinitely without streaming HOT 2
- Error: write ENOTSUP HOT 1
- Create Navbar for small devices HOT 2
- no reasonable clean way to get a timeout on add HOT 1
- Use prettier for easier collaboration HOT 3
- Webtorrent does'nt work for torrents other than the example one. HOT 1
- Prioritize subtitle dowload. HOT 1
- The Docs Need to be UPDATE. HOT 1
- Most urls are broken! HOT 1
- All Torrents stop at exactly 2.8 GB HOT 1
- Webtorrent downloads deselected pieces after re-adding a torrent HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webtorrent.