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 Tornado as the base IO loop #405

Open
giampaolo opened this issue Nov 17, 2016 · 1 comment
Open

Use Tornado as the base IO loop #405

giampaolo opened this issue Nov 17, 2016 · 1 comment

Comments

@giampaolo
Copy link
Owner

giampaolo commented Nov 17, 2016

This is a big refactoring I have in mind which would break backward compatibility. As such this will probably require creating 2 main forks of pyftpdlib, 1.x and 2.x, both of which will have their own doc and GIT branches. I expect there will be a reasonably long period during which I will release 1.x bugfix only releases and implement new features only in the 2.x branch.
Using Tornado as the base IO loop and TCP/SSL transport handler would give us numerous advantages:

PROS

  • an native async HTTP client: it is a very common use case to want to execute certain commands by making async HTTP requests towards external services, especially on login. Right now, the only way to do this is by using ThreadedFTPServer class, which turns pyftpdlib from an async to a threaded server, losing all scalability advantages
  • the possibility to run blocking operations in an async-like thread executor: this is another use-case which requires using ThreadedFTPServer class.
  • the possibility to use co-routines instead of callbacks: this supposedly gives the user the possibility to customize / override the base implementation more easily.
  • the possibility to integrate with Twisted or asyncio IO loops
  • we can get rid of pyftpdlib internal IO loop implementation which despite it is super fast it's one less thing I'll have to maintain
  • we can get rid of the internal SSL handling and delegate it to Tornado; again, one less thing to maintain
  • in general, we can "delegate" all connection / transport related issues to the Tornado project, since we no longer have to maintain a "home made" async IO loop, base TCP and SSL transport stuff. We will also get rid of the asyncore / asynchat dependancy which is clunky and outdated.

CONS

  • tornado IO loop will probably be slower than existent pyftpdlib IO loop, which is very specific to pyftpdlib and has been massively tuned towards performance
  • tornado IO loop does not support sendfile() integration; this will have to done either by patching Tornado or by providing an upstream PR for the Tornado project (see here).
  • breakage of backward compatibilty
@giampaolo
Copy link
Owner Author

@btimby

@giampaolo giampaolo changed the title Use Tornado as base IO loop Use Tornado as the base IO loop Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant