Packages
snakepit
0.6.4
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
mix.exs
defmodule Snakepit.MixProject do
use Mix.Project
@version "0.6.4"
@source_url "https://github.com/nshkrdotcom/snakepit"
def project do
[
app: :snakepit,
version: @version,
elixir: "~> 1.18",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
description: description(),
package: package(),
deps: deps(),
dialyzer: dialyzer(),
docs: docs(),
aliases: aliases(),
name: "Snakepit",
source_url: @source_url,
homepage_url: @source_url
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger],
mod: {Snakepit.Application, []}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:jason, "~> 1.0"},
{:grpc, "~> 0.10.2"},
{:protobuf, "~> 0.14.1"},
{:telemetry_metrics, "~> 1.0"},
{:telemetry_poller, "~> 1.0"},
{:telemetry_metrics_prometheus, "~> 1.1"},
{:opentelemetry, "~> 1.3"},
{:opentelemetry_exporter, "~> 1.6"},
{:opentelemetry_telemetry, "~> 1.0"},
{:stream_data, "~> 1.0", only: [:test]},
{:supertester, "~> 0.2.0", only: :test},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.34", only: :dev, runtime: false}
]
end
defp description do
"""
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.
"""
end
defp package do
[
name: "snakepit",
description: description(),
licenses: ["MIT"],
maintainers: ["nshkrdotcom"],
links: %{
"GitHub" => @source_url,
"Online documentation" => "https://hexdocs.pm/snakepit",
"Architecture Guide" => "https://hexdocs.pm/snakepit/ARCHITECTURE.html",
"gRPC Streaming Guide" => "https://hexdocs.pm/snakepit/README_GRPC.html",
"Changelog" => "#{@source_url}/blob/main/CHANGELOG.md"
},
files: [
"lib",
"priv/proto",
"priv/python/*.py",
"priv/python/requirements*.txt",
"priv/python/setup.py",
"priv/python/snakepit_bridge",
"assets",
"guides",
# Current documentation
"docs/GRPC_QUICK_REFERENCE.md",
"docs/TEST_AND_EXAMPLE_STATUS.md",
"docs/EXAMPLE_TEST_RESULTS.md",
"docs/ECOSYSTEM_ARCHITECTURE.md",
"docs/DSPEX_PRODUCTION_STRATEGY.md",
"docs/code-standards",
"docs/architecture",
# Build configuration
".formatter.exs",
"mix.exs",
# Root documentation
"README.md",
"README_GRPC.md",
"README_BIDIRECTIONAL_TOOL_BRIDGE.md",
"README_PROCESS_MANAGEMENT.md",
"README_TESTING.md",
"README_UNIFIED_GRPC_BRIDGE.md",
"ARCHITECTURE.md",
"DIAGS.md",
"DIAGS2.md",
"LICENSE*",
"CHANGELOG.md"
],
exclude_patterns: [
"**/__pycache__",
"**/*.pyc",
"**/*.egg-info",
"**/*.bak",
"priv/plts",
"priv/data",
"docs/archive",
"priv/python/snakepit_bridge/__pycache__",
"priv/python/snakepit_bridge/adapters/__pycache__",
"priv/python/snakepit_bridge/adapters/showcase/__pycache__",
"priv/python/snakepit_bridge/adapters/showcase/handlers/__pycache__"
]
]
end
defp dialyzer do
[
plt_add_apps: [:mix],
plt_core_path: "priv/plts",
plt_file: {:no_warn, "priv/plts/dialyzer.plt"}
]
end
defp docs do
[
main: "readme",
name: "Snakepit",
source_ref: "v#{@version}",
source_url: @source_url,
homepage_url: @source_url,
assets: %{"assets" => "assets"},
logo: "assets/snakepit-logo.svg",
extras: [
# Main documentation
"README.md",
"CHANGELOG.md",
# Getting started
{"guides/INSTALLATION.md", title: "Installation Guide"},
# Core documentation
{"ARCHITECTURE.md", title: "System Architecture"},
{"DIAGS.md", title: "Performance Architecture"},
{"DIAGS2.md", title: "Architecture Diagrams"},
# Feature documentation
{"README_GRPC.md", title: "gRPC Streaming Guide"},
{"README_BIDIRECTIONAL_TOOL_BRIDGE.md", title: "Bidirectional Tool Bridge"},
{"README_PROCESS_MANAGEMENT.md", title: "Process Management"},
{"README_UNIFIED_GRPC_BRIDGE.md", title: "Unified gRPC Bridge"},
{"README_TESTING.md", title: "Testing Guide"},
# Reference documentation
{"docs/GRPC_QUICK_REFERENCE.md", title: "gRPC Quick Reference"},
{"docs/TEST_AND_EXAMPLE_STATUS.md", title: "Test & Example Status"},
{"docs/EXAMPLE_TEST_RESULTS.md", title: "Example Test Results"},
{"docs/ECOSYSTEM_ARCHITECTURE.md", title: "Ecosystem Architecture"},
{"docs/DSPEX_PRODUCTION_STRATEGY.md", title: "DSPex Production Strategy"},
# v0.6.0 Documentation
{"docs/migration_v0.5_to_v0.6.md", title: "Migration Guide (v0.5 to v0.6)"},
{"docs/performance_benchmarks.md", title: "Performance Benchmarks"},
{"docs/telemetry_events.md", title: "Telemetry Events Reference"},
{"docs/guides/writing_thread_safe_adapters.md", title: "Writing Thread-Safe Adapters"},
{"priv/python/README_THREADING.md", title: "Python Threading Guide"},
# Advanced topics
{"docs/code-standards/test-architecture-supertester.md", title: "Test Architecture"},
{"docs/architecture/adr-001-worker-starter-supervision-pattern.md",
title: "ADR-001: Worker Starter Pattern"}
],
groups_for_extras: [
"Getting Started": [
"guides/INSTALLATION.md",
"docs/migration_v0.5_to_v0.6.md"
],
Guides: [
"README.md",
"docs/guides/writing_thread_safe_adapters.md",
"priv/python/README_THREADING.md"
],
Features: [
"README_GRPC.md",
"README_BIDIRECTIONAL_TOOL_BRIDGE.md",
"README_PROCESS_MANAGEMENT.md",
"README_UNIFIED_GRPC_BRIDGE.md"
],
Architecture: [
"ARCHITECTURE.md",
"DIAGS.md",
"DIAGS2.md"
],
Testing: [
"README_TESTING.md",
"docs/TEST_AND_EXAMPLE_STATUS.md",
"docs/EXAMPLE_TEST_RESULTS.md",
"docs/code-standards/test-architecture-supertester.md"
],
Reference: [
"docs/GRPC_QUICK_REFERENCE.md",
"docs/telemetry_events.md",
"docs/performance_benchmarks.md",
"docs/ECOSYSTEM_ARCHITECTURE.md",
"docs/DSPEX_PRODUCTION_STRATEGY.md"
],
Advanced: [
"docs/architecture/adr-001-worker-starter-supervision-pattern.md"
],
"Release Notes": [
"CHANGELOG.md"
]
],
groups_for_modules: [
"Core API": [
Snakepit,
Snakepit.Adapter,
Snakepit.SessionHelpers
],
"Pool Management": [
Snakepit.Pool,
Snakepit.Pool.WorkerSupervisor,
Snakepit.Pool.Worker.Starter
],
Workers: [
Snakepit.GRPCWorker
],
"Session & State": [
Snakepit.Bridge.SessionStore,
Snakepit.Bridge.Session
],
Adapters: [
Snakepit.Adapters.GRPCPython
],
"Process Management": [
Snakepit.Pool.ProcessRegistry,
Snakepit.Pool.ApplicationCleanup,
Snakepit.ProcessKiller
],
Registry: [
Snakepit.Pool.Registry,
Snakepit.Pool.Worker.StarterRegistry
],
"gRPC & Bridge": [
Snakepit.GRPC.BridgeServer,
Snakepit.GRPC.Client,
Snakepit.GRPC.Endpoint,
Snakepit.Bridge.ToolRegistry
],
Utilities: [
Snakepit.Telemetry,
Snakepit.Utils,
Snakepit.RunID
]
],
before_closing_head_tag: &docs_before_closing_head_tag/1,
before_closing_body_tag: &docs_before_closing_body_tag/1
]
end
defp docs_before_closing_head_tag(:html) do
"""
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
"""
end
defp docs_before_closing_head_tag(_), do: ""
defp docs_before_closing_body_tag(:html) do
"""
<script>
document.addEventListener("DOMContentLoaded", function () {
mermaid.initialize({
startOnLoad: true,
theme: "default",
themeVariables: {
primaryColor: "#6366f1",
primaryTextColor: "#fff",
primaryBorderColor: "#4f46e5",
lineColor: "#6b7280",
sectionBkgColor: "#f3f4f6",
altSectionBkgColor: "#ffffff",
gridColor: "#e5e7eb",
secondaryColor: "#e0e7ff",
tertiaryColor: "#f1f5f9"
}
});
});
</script>
"""
end
defp docs_before_closing_body_tag(_), do: ""
defp aliases do
[
"grpc.gen": [
"cmd mkdir -p lib/snakepit/grpc/generated",
"cmd protoc --elixir_out=plugins=grpc:./lib/snakepit/grpc/generated --proto_path=priv/proto priv/proto/snakepit_bridge.proto"
]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
end