Code Monkey home page Code Monkey logo

ertorrent's People

Contributors

olof avatar orzen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

olof jxub

ertorrent's Issues

Torrent gen server

Generic server for torrent process.

Following is a list of initial tasks for this issue:
-Receives metadata, regarding a certain torrent (this includes magnets).
-Support states (open/closed)
-Communicate with the tracker during .
-Provide peer lists to the peer_sup
-Provide information regarding the torrent it has been assigned.

Peer transfer rate

Implement a way to measure the packet size over time in order to get the current transfer rate for the peer communication.

Pluggable storage driver

We should not assume that we can use local filesystem as storage. The way we save data should be pluggable. We can imagine a default implementation using local filesystem, but we can also imagine things like Amazon S3 or in-memory storage for high performance applications.

Bundled file writings

The first implementation of the file handler will use file:pwrite/3 when writing bytes to file. These writes could be improved by bundled and then written by using file:pwrite/2.

Set up a continuous integration environment

Set up an environment where testing becomes a necessary step in integrating changes. Like Travis or similar. This to make sure that we never introduce bad changes (as defined by our test coverage :-)).

Lifetime of a worker process

An OTP application contains a supervision tree design.

A supervision tree design contains a supervisor process that keeps track of a server process and another supervisor process, this supervisor is referred to, as the super supervisor (visualized below). The second supervisor will keep track of workers. The supervisor will spawn and terminate workers based on internal API calls to the server process.

o super supervisor
|- server
|- supervisor
| |- worker X
| |- worker Y

In cases where there are multiple processes depending on a certain worker's existence. It becomes relevant to have a life span that is implicitly controlled by these processes. This could be handled in multiple ways and therefore this discussion. An example where it is relevant within ertorrent is the handling of tracker worker processes. Multiple torrents might want to communicate with the same tracker, the tracker worker process can therefore not get killed off when one of the torrent processes consider itself to finished with the communication.

Two suggestions is reference counting and timeout.

A passive approach is timeout. When a process is needed it is spawned and it live as long as the depending processes is feeding it. When fed, the process will reset its timer. The risks with this approach is inefficiency and it's considered a fragile design. The fragile part is that the process risk to terminate when another process is about to feed it.

In my opinion the reference counting is more robust and won't leave processes alive and awaiting termination and therefore more efficient.

Thoughts and opinions?

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.