Skip to main content

a simplest common middleware framework for python.

Project description

anyflow

a simplest common middleware framework for python.

HOW-TO-USE

from anyflow import Flow

flow = Flow()

@flow.use()
def middleware_1(ctx, next):
    ctx.state['value'] = 1
    # call the next middleware (middleware_2):
    return next()

@flow.use()
def middleware_2(ctx, next):
    print(ctx.state['value'])
    # next middleware does not exists, call nothing:
    return next()

flow.run()

Project details


Download files

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

Source Distribution

anyflow-0.2.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

anyflow-0.2.0-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page