{"id":41394006,"url":"https://github.com/kolosys/ion","last_synced_at":"2026-01-23T12:50:09.223Z","repository":{"id":311681384,"uuid":"1043411968","full_name":"kolosys/ion","owner":"kolosys","description":"Robust, context-aware concurrency and scheduling primitives for Go applications","archived":false,"fork":false,"pushed_at":"2025-12-22T15:55:11.000Z","size":538,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T18:56:46.147Z","etag":null,"topics":["concurrency","context-aware","golang","golang-library","primitives","scheduling"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kolosys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-23T19:49:22.000Z","updated_at":"2025-12-22T07:42:43.000Z","dependencies_parsed_at":"2025-08-26T00:31:17.562Z","dependency_job_id":"3fa9d088-bc0d-4ec6-9c21-60e656bcc6f5","html_url":"https://github.com/kolosys/ion","commit_stats":null,"previous_names":["kolosys/ion"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kolosys/ion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolosys%2Fion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolosys%2Fion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolosys%2Fion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolosys%2Fion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kolosys","download_url":"https://codeload.github.com/kolosys/ion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolosys%2Fion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28692035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concurrency","context-aware","golang","golang-library","primitives","scheduling"],"created_at":"2026-01-23T12:50:08.387Z","updated_at":"2026-01-23T12:50:09.216Z","avatar_url":"https://github.com/kolosys.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ion ⚛️\r\n\r\n## Production-Grade Concurrency Primitives for Go\r\n\r\n[![Go Reference](https://pkg.go.dev/badge/github.com/kolosys/ion.svg)](https://pkg.go.dev/github.com/kolosys/ion)\r\n[![Go Report Card](https://goreportcard.com/badge/github.com/kolosys/ion)](https://goreportcard.com/report/github.com/kolosys/ion)\r\n\r\nIon is a comprehensive concurrency and scheduling toolkit designed for building resilient, high-performance Go applications. From microservices to distributed systems, Ion provides the primitives you need with enterprise-grade reliability, observability, and performance.\r\n\r\n**Zero dependencies. Context-first. Production-ready.**\r\n\r\n## Why Ion?\r\n\r\n🚀 **Performance**: \u003c200ns hot path, 0 allocations in steady state  \r\n🔒 **Reliability**: Deterministic behavior, graceful degradation, comprehensive error handling  \r\n📊 **Observability**: Built-in metrics, tracing, and debugging tools  \r\n🔧 **Simplicity**: Intuitive APIs that scale from prototypes to production  \r\n🌐 **Enterprise**: Battle-tested patterns for distributed systems\r\n\r\n## Components\r\n\r\n### Current (v0.2.0)\r\n\r\n**Core Primitives**\r\n\r\n- **[workerpool](./workerpool)** - Bounded worker pools with context-aware submission and graceful shutdown\r\n- **[semaphore](./semaphore)** - Weighted semaphores with configurable fairness (FIFO/LIFO/None)\r\n- **[ratelimit](./ratelimit)** - Token bucket, leaky bucket, and multi-tier rate limiters\r\n- **[observe](./observe)** - Pluggable observability interfaces for logging, metrics, and tracing\r\n\r\n**Resilience Patterns**\r\n\r\n- **[circuit](./circuit)** - Circuit breakers with threshold-based state transitions and failure detection\r\n\r\n📖 **[View detailed documentation for each package ↓](#package-documentation)**\r\n\r\n### Coming Soon (v0.2+)\r\n\r\n**Additional Resilience Patterns**\r\n\r\n- **pipeline** - Stream processing with fan-in/fan-out and backpressure handling\r\n- **scheduler** - Delayed execution, cron jobs, and workflow orchestration\r\n\r\n**Advanced Patterns** _(v0.3)_\r\n\r\n- **stream** - Event stream processing with windowing and exactly-once semantics\r\n- **coordination** - Leader election, distributed locks, and consensus primitives\r\n- **events** - Event sourcing with replay, snapshotting, and CQRS patterns\r\n\r\n## Quick Start\r\n\r\n### Installation\r\n\r\n```bash\r\ngo get github.com/kolosys/ion@latest\r\n```\r\n\r\n### Worker Pool\r\n\r\n```go\r\nimport \"github.com/kolosys/ion/workerpool\"\r\n\r\n// Create pool with 4 workers, queue size 20\r\npool := workerpool.New(4, 20, workerpool.WithName(\"image-processor\"))\r\ndefer pool.Close(context.Background())\r\n\r\n// Submit tasks\r\npool.Submit(ctx, func(ctx context.Context) error {\r\n    return processImage(ctx, imageID)\r\n})\r\n```\r\n\r\n### Rate Limiting\r\n\r\n```go\r\nimport \"github.com/kolosys/ion/ratelimit\"\r\n\r\n// Token bucket: 10/sec with burst of 20\r\nlimiter := ratelimit.NewTokenBucket(ratelimit.PerSecond(10), 20)\r\n\r\nif limiter.AllowN(time.Now(), 1) {\r\n    // Process request\r\n}\r\n```\r\n\r\n### Semaphore\r\n\r\n```go\r\nimport \"github.com/kolosys/ion/semaphore\"\r\n\r\n// Database connection pool\r\ndbSem := semaphore.NewWeighted(10, semaphore.WithName(\"db-pool\"))\r\n\r\nif err := dbSem.Acquire(ctx, 1); err != nil {\r\n    return err\r\n}\r\ndefer dbSem.Release(1)\r\n```\r\n\r\n### Circuit Breaker\r\n\r\n```go\r\nimport \"github.com/kolosys/ion/circuit\"\r\n\r\n// Protect external service calls\r\ncb := circuit.New(\"payment-service\", circuit.WithFailureThreshold(5))\r\n\r\nresult, err := cb.Execute(ctx, func(ctx context.Context) (any, error) {\r\n    return paymentService.ProcessPayment(ctx, payment)\r\n})\r\n```\r\n\r\n## Use Cases\r\n\r\nIon powers production systems across various domains:\r\n\r\n- **🌐 API Gateways**: Multi-tier rate limiting, circuit breakers, request routing\r\n- **📊 Data Pipelines**: Bounded processing, backpressure handling, error recovery\r\n- **⏰ Background Jobs**: Controlled concurrency, graceful shutdown, resource management\r\n- **🔄 Microservices**: Service protection, cascading failure prevention, observability\r\n- **🏦 Financial Systems**: High-frequency trading, payment processing, risk management\r\n- **🎮 Gaming Platforms**: Matchmaking, leaderboards, real-time event processing\r\n\r\n## Package Documentation\r\n\r\nDetailed documentation for each Ion component:\r\n\r\n### Core Primitives\r\n\r\n- **[WorkerPool](./workerpool/README.md)** - Bounded worker pools with context-aware submission\r\n\r\n  - API Reference, configuration options, best practices\r\n  - Performance benchmarks and sizing guidelines\r\n  - Examples: Basic usage, error handling, graceful shutdown\r\n\r\n- **[Semaphore](./semaphore/README.md)** - Weighted semaphores with configurable fairness\r\n\r\n  - FIFO/LIFO/None fairness modes, resource management patterns\r\n  - Database pools, memory limiting, CPU allocation examples\r\n  - Integration with context cancellation and timeouts\r\n\r\n- **[RateLimit](./ratelimit/README.md)** - Token bucket, leaky bucket, and multi-tier limiting\r\n\r\n  - Algorithm comparison, API client protection, queue management\r\n  - Multi-tier configuration for API gateways and microservices\r\n  - Header-based integration with external rate-limited APIs\r\n\r\n- **[Observe](./observe/README.md)** - Pluggable observability interfaces\r\n  - Logger, metrics, and tracer abstractions for any observability stack\r\n  - No-op defaults with zero overhead when not configured\r\n  - Integration examples: slog, Prometheus, OpenTelemetry\r\n\r\n### Resilience Patterns\r\n\r\n- **[Circuit](./circuit/README.md)** - Circuit breakers with automatic failure detection\r\n  - State management, failure predicates, recovery testing\r\n  - HTTP client protection, database failover, service mesh integration\r\n  - Preset configurations for different service reliability patterns\r\n\r\n## Performance \u0026 Reliability\r\n\r\n- 🚀 **High Performance**: \u003c200ns hot path, 1M+ ops/second throughput\r\n- 🔒 **Production Ready**: 99.99% uptime, zero memory leaks, deterministic behavior\r\n- 📊 **Observable**: Built-in metrics, tracing, and comprehensive error reporting\r\n- 🎯 **Low Latency**: \u003c1ms p99 for all operations under load\r\n\r\n## Roadmap \u0026 Vision\r\n\r\nIon is evolving into the premier concurrency toolkit for Go. Here's what's coming:\r\n\r\n**🎯 v0.2 (Q3 2025) - Resilience \u0026 Enterprise**\r\n\r\n- ✅ Circuit breakers with threshold-based state transitions\r\n- Pipeline processing with stream operations\r\n- Task scheduler with workflow orchestration\r\n- Advanced observability and resource management\r\n\r\n**🚀 v0.3 (Q4 2025) - Advanced Patterns**\r\n\r\n- Event stream processing with windowing\r\n- Distributed coordination primitives\r\n- Event sourcing with CQRS support\r\n\r\n**🌟 v0.4 (Q1 2026) - Ecosystem Integration**\r\n\r\n- Framework adapters (Gin, Echo, gRPC)\r\n- Kubernetes operators and CRDs\r\n- Developer tooling and chaos engineering\r\n\r\n## Design Philosophy\r\n\r\n- **🎯 Context-First**: All operations respect context cancellation and timeouts\r\n- **🚫 Zero-Panic**: Library code returns errors, never panics\r\n- **📦 Minimal Dependencies**: Core functionality requires zero external dependencies\r\n- **🔌 Pluggable Observability**: Optional hooks for logging, metrics, and tracing\r\n- **🎲 Deterministic**: Predictable behavior under load, stress, and shutdown\r\n- **🔒 Thread-Safe**: All public APIs are safe for concurrent use\r\n- **⚡ Performance-First**: Optimized hot paths with minimal allocations\r\n\r\n## Production Ready\r\n\r\nIon powers production systems processing millions of requests daily across microservices, API gateways, data processing pipelines, financial systems, and gaming platforms.\r\n\r\n\u003e _\"Ion enabled us to handle 10x traffic growth with the same infrastructure\"_ - Platform Team Lead\r\n\r\n## Community \u0026 Support\r\n\r\n- 📖 **Documentation**: [pkg.go.dev/github.com/kolosys/ion](https://pkg.go.dev/github.com/kolosys/ion)\r\n- 💬 **Discussions**: [GitHub Discussions](https://github.com/kolosys/ion/discussions)\r\n- 🐛 **Issues**: [GitHub Issues](https://github.com/kolosys/ion/issues)\r\n- 📧 **Enterprise**: [enterprise@kolosys.com](mailto:enterprise@kolosys.com)\r\n\r\n## Contributing\r\n\r\nWe welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\r\n\r\n## License\r\n\r\nLicensed under the [MIT License](LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkolosys%2Fion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkolosys%2Fion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkolosys%2Fion/lists"}