Packages
snakepit
0.3.0
0.13.0
0.12.0
0.11.1
0.11.0
0.10.1
0.10.0
0.9.1
0.9.0
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.11
0.6.10
0.6.9
0.6.8
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0
0.5.1
0.5.0
0.4.3
0.4.2
0.4.1
0.4.0
0.3.3
0.3.2
0.3.1
0.3.0
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0
High-performance pooler and session manager for external language integrations. Supports Python, Node.js, Ruby, and more with gRPC streaming, session management, and production-ready process cleanup.
Current section
Files
Jump to
Current section
Files
priv/proto/snakepit.proto
syntax = "proto3";
package snakepit;
// Core gRPC bridge service for external process communication
service SnakepitBridge {
// Simple request/response (existing functionality)
rpc Execute(ExecuteRequest) returns (ExecuteResponse);
// Server streaming (new: progressive results)
rpc ExecuteStream(ExecuteRequest) returns (stream StreamResponse);
// Session management
rpc ExecuteInSession(SessionRequest) returns (ExecuteResponse);
rpc ExecuteInSessionStream(SessionRequest) returns (stream StreamResponse);
// Health check
rpc Health(HealthRequest) returns (HealthResponse);
// Worker info and capabilities
rpc GetInfo(InfoRequest) returns (InfoResponse);
}
// Basic execution request
message ExecuteRequest {
string command = 1;
map<string, bytes> args = 2; // Use bytes for flexibility with binary data
int32 timeout_ms = 3;
string request_id = 4; // Optional request tracking
}
// Basic execution response
message ExecuteResponse {
bool success = 1;
map<string, bytes> result = 2;
string error = 3;
int64 timestamp = 4;
string request_id = 5;
}
// Streaming response chunk
message StreamResponse {
bool is_final = 1;
map<string, bytes> chunk = 2;
string error = 3;
int64 timestamp = 4;
string request_id = 5;
int32 chunk_index = 6; // For ordering
}
// Session-based execution request
message SessionRequest {
string session_id = 1;
string command = 2;
map<string, bytes> args = 3;
int32 timeout_ms = 4;
string request_id = 5;
}
// Health check request
message HealthRequest {
string worker_id = 1; // Optional worker identification
}
// Health check response
message HealthResponse {
bool healthy = 1;
string worker_id = 2;
int64 uptime_ms = 3;
int64 total_requests = 4;
int64 total_errors = 5;
string version = 6;
}
// Worker info request
message InfoRequest {
bool include_capabilities = 1;
bool include_stats = 2;
}
// Worker info response
message InfoResponse {
string worker_type = 1; // "python", "javascript", etc.
string version = 2;
repeated string supported_commands = 3;
map<string, string> capabilities = 4; // Key-value capabilities
WorkerStats stats = 5;
map<string, string> system_info = 6;
}
// Worker statistics
message WorkerStats {
int64 requests_handled = 1;
int64 requests_failed = 2;
int64 uptime_ms = 3;
int64 memory_usage_bytes = 4;
double cpu_usage_percent = 5;
int64 active_sessions = 6;
}