Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Dynamic Task Supervisor for the PeerDownloader #1

Open
mpope9 opened this issue Jan 25, 2020 · 2 comments
Open

Use Dynamic Task Supervisor for the PeerDownloader #1

mpope9 opened this issue Jan 25, 2020 · 2 comments

Comments

@mpope9
Copy link

mpope9 commented Jan 25, 2020

A bit minor, but I see the PeerDownloader just uses Task.async to spawn a new Task. I think a supervisor added to the top level supervision tree would be useful in restarting a peer in case of a network drop? https://hexdocs.pm/elixir/Task.html#module-dynamically-supervised-tasks

Easy to dynamically add a task: Task.Supervisor.async(Bittorent.PeerSupervisor, your_function/1)

@mpope9
Copy link
Author

mpope9 commented Jan 25, 2020

Oh I just read the Architecture section. I still think this is a good option, the PeerDownloader isn't really supervising the Tasks, it just dispatches them if I am understanding this correctly.

@bessey
Copy link
Owner

bessey commented Feb 4, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants