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

Retry

A generic retry policy middleware (not specific to network requests). Will retry upon exception until meeting a max_retries threshold.

API

# all params have default values
retry(
    max_retries=3
)

Usage

from formation.middleware import retry

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