Memory Storage
In-memory FSM backend for development and testing. Data is lost on restart.
Usage
from pyrogram_patch.fsm import MemoryStorage
storage = MemoryStorage()
manager.set_storage(storage)When to Use
| Scenario | Recommended |
|---|---|
| Local development | ✅ MemoryStorage |
| Testing | ✅ MemoryStorage |
| Single-process production | ⚠️ Acceptable if data loss is OK |
| Multi-process / HA production | ❌ Use RedisStorage |
Behavior
MemoryStorage uses a simple dict keyed by (chat_id, user_id). It implements the BaseStorage interface with no external dependencies. All operations are O(1).