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

RUMM-1615 Create RUMCommandPublisher to publish RUM command to a subscriber #649

Merged
merged 1 commit into from
Oct 26, 2021

Conversation

maxep
Copy link
Member

@maxep maxep commented Oct 26, 2021

What and why?

Introduce the RUMCommandPublisher protocol to unify command publishers interface. This small refactoring prepares for the upcoming SwiftUI view handler.

How?

The RUMCommandPublisher enforce that any publisher implement the same method signature.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference

@maxep maxep requested a review from a team as a code owner October 26, 2021 09:32
@maxep maxep self-assigned this Oct 26, 2021
Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactoring 👌. Even though RUMCommandPublisher is only a blueprint protocol (not much leveraged in testing and DI), I'm up for having this as that clearly embraces our convention around RUM commands processing 👍.

@maxep maxep force-pushed the maxep/RUMM-1615/rum-command-publisher branch from 53c2bb2 to cf0fb2b Compare October 26, 2021 11:39
Copy link
Contributor

@buranmert buranmert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but i didn't fully understand why we needed this for SwiftUI.?

@maxep
Copy link
Member Author

maxep commented Oct 26, 2021

@buranmert It is not needed for SwiftUI, but I found that the naming convention func subscribe(commandsSubscriber: RUMCommandSubscriber) didn't quite reflect the actual command flow (You don't subscribe to a subscriber). Here, I'm explicitly stating that a Publisher publish to a Subscriber, the protocol only unifies the interface of command publishers.

@maxep maxep merged commit 0d6ef03 into feature/swiftui Oct 26, 2021
@maxep maxep deleted the maxep/RUMM-1615/rum-command-publisher branch October 26, 2021 12:25
@maxep maxep mentioned this pull request Dec 1, 2021
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.

3 participants