Getting Started

Prerequisites

  • Python >= 3.6+ (for asyncio)

  • Running redis-server if you plan to use the async redis backend storage

Installing

You can install from PyPI.

$ pip install insanic-infuse

Initializing

Since Infuse is an extension for Insanic, with your initialized Insanic application.

from insanic import Insanic
from infuse import Infuse

app = Insanic("example", version="0.1.0")
Infuse.init_app(app)

What init_app does is:

  1. Loads all the necessary infuse configurations

  2. Patches the Service object’s dispatch method to check for state before sending the request.

  3. Initializes the applications’ status on your storage of choice during Insanic start up.