Skip to content

Releases

v2.5.0: lifecycle failure handling

Choose a tag to compare

@ognick ognick released this 14 Aug 14:04
50c09de

What's changed

  • Define lifecycle failure boundaries: empty Run now panics, and component errors include component names while preserving errors.Is.
  • Add configurable shutdown timeouts through WithShutdownTimeout and ErrShutdownTimeout.
  • Preserve and join independent input, readiness, component, cleanup, and timeout errors without propagated cancellation noise or duplicate causes.
  • Distinguish successful probe(nil) from readiness failures wrapping context.Canceled.
  • Release lifecycle listeners and signal handlers, and simplify parent-readiness coordination.

Pull requests

Release v2.3.0: add dependency graph export in DOT format

Choose a tag to compare

@ognick ognick released this 19 Dec 11:06
7fa7c54
- Add WithGraphOutput() option to auto-save graph on lifecycle start
- Add BuildGraph() method to Lifecycle interface
- Add Graph.ToDOT() method to convert graph to Graphviz DOT format
- Add /graph/dot API endpoint in example app
- Add "Download DOT" button to example web UI
- Update README with graph export documentation

Graph can be visualized using Graphviz tools:
  dot -Tpng graph.dot -o graph.png

Release v2.2.0: Add fluent API and simplified lifecycle management Latest

Choose a tag to compare

@ognick ognick released this 24 Nov 21:45
  • Add Register() helper function for fluent component registration
  • Add Run() helper function for simplified lifecycle execution
  • Enhance lifecycle management with improved error handling
  • Add comprehensive test coverage for new functionality
  • Update example application with new API usage
  • Improve component dependency management and startup order
  • Add support for graceful shutdown hooks with WithShutdownHook()
  • Enhance lifecycle status transitions and error propagation

BREAKING CHANGES:

  • Lifecycle.Run() method signature changed:
  • OLD: Run(ctx context.Context, readinessProbe func(err error)) func() error
  • NEW: Run(ctx context.Context, readinessProbe func(err error)) error
  • Lifecycle is now a Component without casting
  • Added blocking Run() helper method with callback support
  • Lifecycle no longer shuts down on signals by default (use WithShutdownHook() option)

Migration guide:

  • Replace: waitFn := lc.Run(ctx, probe); err := waitFn()
  • With: err := lc.Run(ctx, probe)
  • Use goscade.Run() helper for blocking execution with callback
  • Add WithShutdownHook() option if signal handling is needed

Release v1.2.0: explicit dependency support to Register method

Choose a tag to compare

@ognick ognick released this 08 Oct 13:12
795089b
  • Add implicitDeps parameter to Register method signature
  • Support explicit dependency declaration when automatic detection is insufficient

Release v1.1.0: performance boost & API improvements

Choose a tag to compare

@ognick ognick released this 02 Oct 12:57
f36abd4

🎯 Major Performance Optimization

  • BFS Algorithm: Replaced recursive dependency detection with breadth-first search using queues
  • Memory Efficiency: Optimized component graph traversal for better performance with large component trees
  • Faster Startup: Reduced overhead in dependency resolution phase

🔧 New Adapter Pattern

  • Component Wrapping: Wrap existing components with custom logic using NewAdapter()
  • Custom Startup Logic: Add readiness probes and custom initialization without modifying original components
  • Delegate Naming: Automatic component naming for better logging and debugging

🧪 Enhanced Testing Suite

  • 45 Test Cases: Comprehensive coverage including adapter pattern, timeouts, and nested lifecycles
  • Race Condition Free: All tests pass with -race flag and multiple iterations
  • Timeout Testing: Configurable startup timeouts with proper error handling
  • Nested Lifecycle Tests: Verify lifecycle-as-component functionality

🗑️ Simplified Architecture

  • Removed Metrics System: Eliminated complex metrics collection (107 lines removed)
  • Cleaner API: Focused on core lifecycle management without observability overhead
  • Reduced Dependencies: Simpler codebase with fewer moving parts

🔄 API Consistency

  • Queue Methods: Standardized Push()/Pop() instead of Enqueue()/Dequeue()
  • Nested Lifecycles: AsComponent() method for lifecycle composition
  • Fluent Registration: Register() helper for chaining component creation

📚 Documentation Overhaul

  • Classic README Structure: Moved examples to dedicated "Advanced Usage" section
  • Practical Examples: Real-world usage patterns with adapter pattern
  • Clear API Reference: Comprehensive documentation for all public methods

⚡ Performance Metrics

  • 98.7% Test Coverage: Maintained high code coverage
  • Zero Race Conditions: Verified concurrent safety
  • Optimized Graph Traversal: BFS algorithm for dependency detection
  • Memory Efficient: Reduced allocation overhead in component startup

Breaking Changes: Queue method names changed (Enqueue/Dequeue → Push/Pop)
Migration: Update queue usage in existing code
Compatibility: Full backward compatibility for core lifecycle functionality

Release v1.0.0: adapter pattern, fluent API, configurable timeouts

Choose a tag to compare

@ognick ognick released this 01 Oct 20:28
5ad2e94
  • Add Adapter Pattern for component wrapping
  • Add Queue utilities (FIFO/LIFO)
  • Add Fluent Registration API
  • Add configurable startup timeouts
  • Add circular dependency support
  • Improve test coverage to 98.7%
  • Add comprehensive documentation
  • Update README with examples
  • All tests pass with race detection

Release v0.2.0: simplified startup, parallel dependency resolution

Choose a tag to compare

@ognick ognick released this 10 Jun 07:34

What's new in v0.2.0:

  • Removed runner/context setup from users
  • Added internal graceful shutdown logic via signal handling
  • Dependencies now resolved in parallel for faster startup
  • RunAllComponents returns shutdown wait func
  • Refactored tests, removed errgroup from public API
  • Simplified examples

This version is backward-incompatible due to changes in RunAllComponents.

🚀 First Release: goscade v0.1.0

Choose a tag to compare

@ognick ognick released this 05 Jun 18:02

Initial release of goscade — a lightweight Go library for coordinating component lifecycle with dependency-aware startup and shutdown.

✅ Features:

  • Declarative dependency graph via component registration
  • Automatic topological sort and run-order resolution
  • Controlled startup and shutdown with cancellation
  • Real-time status tracking for each component

📦 Example:

  • Web UI for visualizing the dependency graph and interacting with components
  • Simulated delays and failure injection for testing

🔗 Resources: