[CVW-040] AllMarketTicker플로우, 스트림 구독 요청 주체 변경#52
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the AllMarketTicker flow and changes the WebSocket handler caller from the UseCase to the ViewModel, while also updating the dependency injection registrations accordingly.
- Refactored the repository to convert DTOs into an AVLTree instead of an array.
- Updated the DI assemblies to inject a new stream decoder and remove deprecated exchange rate dependencies.
- Added new DataSource and interface implementations and removed unused services.
Reviewed Changes
Copilot reviewed 102 out of 102 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Projects/Data/Repository/Sources/BinanceAllMarketTickersRepository.swift | Refactored AllMarketTicker repository to return an AVLTree via both a Combine publisher and async method. |
| Projects/Data/Project.swift | Added deployment target configuration to the project. |
| Projects/Data/DataSource/Sources/Util/LockedDictionary.swift | Introduced a thread-safe dictionary utility. |
| Projects/Data/DataSource/Sources/Service/Network/WebSocket/BinanceWebSocketService.swift | Removed an unused dependency import. |
| Projects/App/Sources/DI/Assembly/SharedAssembly.swift | Updated DI registrations to include the new stream decoder and remove obsolete services. |
| Projects/App/Sources/AppDelegate.swift | Removed the direct exchange rate fetch call from the initial tasks. |
| Others | Various new interfaces, DataSources, and DI adjustments supporting the refactored flows. |
Comments suppressed due to low confidence (2)
Projects/Data/Repository/Sources/BinanceAllMarketTickersRepository.swift:29
- [nitpick] Consider renaming the Combine-based getAllMarketTicker method (e.g., to getAllMarketTickerPublisher) so that it is clearly distinguishable from the async version.
public func getAllMarketTicker() -> AnyPublisher<AVLTree<Twenty4HourTickerForSymbolVO>, Never> {
Projects/Data/Repository/Sources/BinanceAllMarketTickersRepository.swift:37
- [nitpick] Consider renaming the async variant of getAllMarketTicker (e.g., to getAllMarketTickerAsync) to avoid confusion with the publisher-based method.
public func getAllMarketTicker() async -> AVLTree<Twenty4HourTickerForSymbolVO> {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경된점
AllMarketTicker플로우 리팩토링
기존 플로우
#50 , #51 과 비슷한 이유로 리팩토링이 필요하다고 판단했습니다.
변경된 플로우
웹소켓 핸들러 호출 주체 변경(스트림 구독 요청 주체 변경)
기존 UseCase에서 스트림 연결 요청을 직접 진행하였지만 해당 기능은 바이낸스 API에 의존적인 기능이며 비즈니스 로직과는 무관하다고 생각했습니다.
따라서 ViewModel에서 스트림 구독을 요청하도록 수정했습니다.
스트림 자체는 엔티티로 추상화하여 최대한 외부의존성을 배제시켰습니다.
스트림 엔티티는 아래와 같습니다.
전달된 스트림을 외부API의 포맷에 맞는 스트림 문자열로 디코딩하는 객체(StreamDecoder)를 주입하는 방식으로 의존성을 최소화 했습니다.
생성자에서 주입합니다.