Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPT-1998 Поддержка combine #123

Merged
merged 6 commits into from
Apr 24, 2024
Merged

Conversation

mrandrewsmith
Copy link
Collaborator

@mrandrewsmith mrandrewsmith commented Apr 1, 2024

Что сделано

  • Старая реализация метода process() -> Observer переименована в processLegacy и помечена depricated для избежания конфликтов с новой реализацией.
  • Добавлены новые протоколы CombineNode и CombineStreamNode с поддержкой Combine.
  • Добавлен метод в AsyncNode, оборачивающий себя в CombineNode.
  • Добавлен метод в AsyncStreamNode, оборачивающий себя в CombineStreamNode.
  • Добавлены шорт досутупы к value и error в NodeResult.
  • Написаны тесты на новый функционал.

На что обратить внимание

Combine был доработан в этом PR. Рекомендуется смотреть вместе.

Пример использования для AsyncNode

ChainConfigurator()
    .build() // <- Возвращает AsyncNode
    .combineNode() // <- Возвращает CombineNode
    .nodeResultPublisher()
    .sink {
    }

Пример использования для AsyncStreamNode

let node = ChainConfigurator()
    .build() // <- Возвращает AsyncStreamNode
    .combineStreamNode() // <- Возвращает CombineStreamNode

node.nodeResultPublisher()
    .sink {
    }

node.process()

NodeKit/Core/Node/Combine/CombineNode.swift Outdated Show resolved Hide resolved
NodeKit/Core/Node/Combine/CombineNode.swift Outdated Show resolved Hide resolved
@mrandrewsmith mrandrewsmith requested a review from NullIsOne April 3, 2024 15:01
@mrandrewsmith mrandrewsmith force-pushed the SPT-1998-combine-support branch 4 times, most recently from 141a309 to 2e154a5 Compare April 3, 2024 16:49
@mrandrewsmith mrandrewsmith self-assigned this Apr 3, 2024
NodeKit/Core/Node/Async/AsyncNode.swift Outdated Show resolved Hide resolved
@mrandrewsmith mrandrewsmith force-pushed the SPT-1998-swift-cuncurrency-support branch from cf47973 to d3ae0e1 Compare April 16, 2024 11:47
@mrandrewsmith mrandrewsmith force-pushed the SPT-1998-combine-support branch from b910b36 to a94c1fe Compare April 16, 2024 11:53
@mrandrewsmith mrandrewsmith changed the base branch from SPT-1998-swift-cuncurrency-support to 5.0.0 April 16, 2024 16:23
@mrandrewsmith mrandrewsmith merged commit c0dcc12 into 5.0.0 Apr 24, 2024
3 checks passed
@mrandrewsmith mrandrewsmith deleted the SPT-1998-combine-support branch May 7, 2024 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants