GithubHelp home page GithubHelp logo

Comments (7)

astro avatar astro commented on May 22, 2024

Alternatively, letting the user override Server.prototype._getSwarm() will allow custom peer database backends. I wouldn't want to keep all that data in v8 when running a huge tracker.

from bittorrent-tracker.

feross avatar feross commented on May 22, 2024

I see, so we could support filter by treating a null return value from _getSwarm as an indication that the torrent should not be tracked. That should work for @pwmckenna's use case.

@astro One other thing to figure out: how will you determine when the properties of the returned swarm object (swarm.complete, swarm.incomplete, swarm.peers) is changed? You need to know when values change in order to update the custom storage backend.

from bittorrent-tracker.

pwmckenna avatar pwmckenna commented on May 22, 2024

While filtering could piggyback on the storage adapter solution, they feel like very different issues. I'd find an explicit solution more intuitive than one where I have to override a method and return a value that is understood to mean "I'm intentionally not supporting this swarm because its hash doesn't match a whitelist". Certainly not tied to the api I suggested, but I'd prefer to not override something to return null to achieve whitelisting.

from bittorrent-tracker.

pwmckenna avatar pwmckenna commented on May 22, 2024

with regards to the storage adapter...i took a quick look and realized that everything in there assumes synchronous gets/sets. to convert everything to async, do you have a preference of supporting lib (async/q/etc...), or just straight callbacks all the way through?

from bittorrent-tracker.

feross avatar feross commented on May 22, 2024

@pwmckenna, fair enough. I would accept a PR that added a filter option, as demonstrated in your initial code example.

If we need flow control, I prefer using run-parallel, run-series, run-auto, etc. which are just extracted out of async.

from bittorrent-tracker.

feross avatar feross commented on May 22, 2024

@pwmckenna Astro's getSwarm changes are in, so it would be pretty easy to send a PR to add filtering now.

from bittorrent-tracker.

feross avatar feross commented on May 22, 2024

Implemented in #57 and released as 3.0.0.

from bittorrent-tracker.

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.