Skip to content

feat: add common_system integration adapters #197

Description

@kcenon

Summary

  • Implemented adapter pattern to integrate thread_system with common_system standard interfaces
  • Added conditional compilation support via USE_COMMON_SYSTEM flag for optional integration
  • Updated build configuration and documentation to reflect ecosystem integration capabilities

Changes

New Adapters

  • common_system_executor_adapter: Bridges thread_pool to common::interfaces::IExecutor
  • common_system_logger_adapter: Adapts thread_system logger to common::interfaces::ILogger
  • common_system_monitoring_adapter: Exposes thread metrics through common::interfaces::IMonitoring

Build System Updates

  • Added USE_COMMON_SYSTEM CMake option for conditional compilation
  • Updated CMakeLists.txt to support common_system integration when enabled

Documentation

  • Updated ARCHITECTURE.md with ecosystem integration notes
  • Clarified that network_system integrates via adapters without hard dependencies

Purpose

This PR enables thread_system to seamlessly integrate with the broader ecosystem through common_system's standardized interfaces. Key benefits:

  • Interoperability: Thread pools can be used by any module supporting IExecutor interface
  • Consistency: Unified logging and monitoring across all ecosystem modules
  • Flexibility: Optional integration via compile flag preserves backward compatibility
  • Modularity: Adapter pattern allows gradual migration without breaking existing code

Technical Details

The adapters use conditional compilation (#ifdef USE_COMMON_SYSTEM) to:

  • Maintain zero overhead when integration is disabled
  • Allow progressive adoption across projects
  • Preserve existing thread_system APIs while adding common_system compatibility

Test Plan

  • Verify compilation with USE_COMMON_SYSTEM=OFF (default behavior)
  • Test compilation with USE_COMMON_SYSTEM=ON
  • Validate adapter implementations match interface contracts
  • Test thread_pool functionality through executor adapter
  • Verify logger adapter correctly maps log levels
  • Confirm monitoring adapter exposes accurate metrics
  • Integration test with network_system using shared interfaces

Linked PR: #22 feat: add common_system integration adapters

Metadata

Metadata

Assignees

Labels

buildBuild system and configurationci-cdCI/CD and build automationdependenciesExternal dependencies managementenhancementNew feature or requestloggingLogging related changestestingTesting related issuesthreadingThreading and concurrency

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions