Summary
Migrate logger_system's thread_system integration from direct dependency to using common_system's IExecutor interface as a neutral abstraction layer.
Parent Issue
Background
Issue #252 identified two approaches for resolving bidirectional dependency risk:
This issue implements Option B for a cleaner architectural solution.
Current State
// Current: Direct thread_system dependency
#include <kcenon/thread/core/thread_pool.h>
class async_logger {
std::shared_ptr<kcenon::thread::thread_pool> pool_;
};
Proposed Solution
// Proposed: Use IExecutor interface from common_system
#include <kcenon/common/interfaces/executor.h>
class async_logger {
public:
explicit async_logger(std::shared_ptr<common::interfaces::IExecutor> executor)
: executor_(std::move(executor)) {}
void log(const log_entry& entry) {
executor_->execute([this, entry] {
write_to_backend(entry);
});
}
private:
std::shared_ptr<common::interfaces::IExecutor> executor_;
};
Benefits
- No compile-time dependency between logger and thread_system
- Neutral abstraction - common_system is already required by both
- Flexibility - Users can provide custom executors
- Testability - Mock executors for unit testing
- Future-proof - Can swap executor implementations
Tasks
Acceptance Criteria
Priority
MEDIUM - Architectural improvement, not blocking production use
Related
Summary
Migrate logger_system's thread_system integration from direct dependency to using common_system's IExecutor interface as a neutral abstraction layer.
Parent Issue
Background
Issue #252 identified two approaches for resolving bidirectional dependency risk:
This issue implements Option B for a cleaner architectural solution.
Current State
Proposed Solution
Benefits
Tasks
thread_integration_detector.hto check for IExecutorthread_system_integrationclass to use IExecutorAcceptance Criteria
Priority
MEDIUM - Architectural improvement, not blocking production use
Related