Formation

Formation

  • Docs

›Middleware

Introduction

  • About Formation
  • Using Formation with Requests
  • Structured Queries with Attrs

Examples

  • Posting Data
  • Production Ready Clients
  • Scraping Web Sites

Middleware

  • Accept
  • Circuit Breaker
  • Context Logger
  • Context
  • Duration
  • Request ID
  • Retry
  • Timeout

Building Middleware

  • A Simple Middleware
  • Thread Safety and Concurrency

Request Duration

Sets request duration in context for other middleware to use down the pipeline. See logger for how it's being used.

Usage

from formation.middleware import request_duration

@client
class Google(object):
    base_uri = "https://google.com"
    middleware=[
        request_duration()
    ]
    ...
← ContextNext →
  • Usage
Formation
Docs
Getting StartedExamplesMiddleware
Community
Stack OverflowTwitter
More
GitHubStar
Copyright © 2019 Dotan Nahum