Skip to main content

Async FDFS Client for tornado

Project description

This library provides an async FDFS client for tornado.


install using pip:

$ pip install fdfs-tornado

Basic Usage

init a client

use tracker_ip and tracker_port to initialize the FDFS Client. Create a single client for a specific case.

from fdfs_tornado.client import makeclient

AsyncFDFSClient = makeclient(tracker_ip, tracker_port)
client = AsyncFDFSClient()


the client will not create any connection before upload or download actions.

upload a file

To upload a file. First open the file in binary mode, and get the size, those are required.

from tornado.ioloop import IOLoop
ioloop = IOLoop.instance()

client = AsyncFDFSClient()
with open(filename, 'rb') as f:
    file_size = os.stat(filename).st_size
    future = client.upload(f, file_size)
    future.add_done_callback(lambda _: ioloop.close())

    ret = future.result()

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fdfs-tornado, version 0.1a1
Filename, size File type Python version Upload date Hashes
Filename, size fdfs-tornado-0.1a1.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page