Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Outline

Basic Asynchronous Example

This example demonstrates the basic usage of the Replane Python SDK with the asynchronous client.

Prerequisites

  • Python 3.10 or higher
  • A running Replane server
  • An SDK key from your Replane dashboard

Setup

  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Update configuration in main.py:
BASE_URL = "https://your-replane-server.com"
SDK_KEY = "your_sdk_key_here"

Run

python main.py

What This Example Shows

  • Using the AsyncReplane with async context manager
  • Reading feature flags and configs (sync read from local cache)
  • Passing context for override evaluation
  • Using default values for missing configs
  • Manual async client lifecycle
  • Subscribing to config changes (sync and async callbacks)
  • Real-time config updates

Note on client.get()

The get() method is intentionally synchronous even in the async client because it only reads from the local in-memory cache. There's no I/O involved, so there's no benefit to making it async. The SSE connection that keeps the cache updated runs in a background task.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.