FutureFinity 0.2.0 Documentation¶
Overview¶
FutureFinity is an asynchronous Python web framework designed for asyncio and native coroutines. Benefit from the non-blocking model and asyncio, FutureFinity can handle thousands of requests at the same time.
The Source Code is hosted on GitHub.
Hello, World!¶
import futurefinity.web
import asyncio
app = futurefinity.web.Application()
@app.add_handler("/")
class RootHandler(futurefinity.web.RequestHandler):
async def get(self, *args, **kwargs):
return "Hello, World!"
app.listen(23333)
try:
asyncio.get_event_loop().run_forever()
except KeyboardInterrupt:
pass
Installation¶
The installation of FutureFinity is as sample as install other applications through pip:
pip install futurefinity
Install from GitHub master branch:
pip install git+git://github.com/futursolo/futurefinity.git
Install from source code:
Download FutureFinity-0.2.0.tar.gz:
tar xvzf futurefinity-(version).tar.gz
cd futurefinity-(version)
python setup.py install
If this is not a stable release of FutureFinity, please do unittest before you use it:
python setup.py test
If any tests failed, please report an issue.
System Dependencies¶
FutureFinity 0.2.0 will only work on Python 3.5.1 or higher.
Optional Dependencies:
- Cryptograhy is the crypto library currently used by FutureFinity’s security features.
- Jinja2 is the template library currently used by FutureFinity’s template rendering.
Platform:
Theoretically, FutureFinity can run on any system that supports asyncio. However, asyncio.SelectorEventLoop has a really low performance on windows and cannot handle over 512 handlers at the same time, and asyncio.ProactorEventLoop cannot support many features of asyncio. We recommend that running FutureFinity on Windows for only development use.
Also see:¶
- FutureFinity Tutorial
futurefinity.web
– FutureFinty WebApplication
and WebRequestHandler
futurefinity.server
– FutureFinity HTTPServer Classfuturefinity.client
– FutureFinity HTTP Clientfuturefinity.protocol
– HTTP Protocol Implementationfuturefinity.routing
– FutureFinity Path Routingfuturefinity.security
– FutureFinity Cryptography Implementationfuturefinity.template
– FutureFinity Template Wrapperfuturefinity.utils
– FutureFinity Utilities