ccproxy.plugins.claude_sdk.session_pool¶
ccproxy.plugins.claude_sdk.session_pool
¶
Session-aware connection pool for persistent Claude SDK connections.
SessionPool
¶
Manages persistent Claude SDK connections by session.
Source code in ccproxy/plugins/claude_sdk/session_pool.py
start
async
¶
Start the session pool and cleanup task.
Source code in ccproxy/plugins/claude_sdk/session_pool.py
stop
async
¶
Stop the session pool and cleanup all sessions.
Source code in ccproxy/plugins/claude_sdk/session_pool.py
get_session_client
async
¶
Get or create a session context for the given session_id.
Source code in ccproxy/plugins/claude_sdk/session_pool.py
interrupt_session
async
¶
Interrupt a specific session due to client disconnection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_id
|
str
|
The session ID to interrupt |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if session was found and interrupted, False otherwise |
Source code in ccproxy/plugins/claude_sdk/session_pool.py
interrupt_all_sessions
async
¶
Interrupt all active sessions (stops ongoing operations).
Returns:
| Type | Description |
|---|---|
int
|
Number of sessions that were interrupted |
Source code in ccproxy/plugins/claude_sdk/session_pool.py
has_session
async
¶
get_stats
async
¶
Get session pool statistics.