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-830 Add consent provider #328

Merged
merged 2 commits into from
Dec 7, 2020

Conversation

ncreated
Copy link
Member

@ncreated ncreated commented Dec 2, 2020

What and why?

📦 As the next part of tracking consent feature, this PR introduces the ConsentProvider.

How?

ConsentProvider implements basic subscription model. The ConsentAwareDataWriter reads the consent value and subscribes to its updates.

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

@ncreated ncreated self-assigned this Dec 2, 2020
@ncreated ncreated requested a review from a team as a code owner December 2, 2020 08:26
Comment on lines +63 to +65
objc_sync_enter(self)
block()
objc_sync_exit(self)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is totally fine 👍 i'm just wondering why we didn't use self.queue?

Copy link
Member Author

@ncreated ncreated Dec 7, 2020

Choose a reason for hiding this comment

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

It's because in this PR the FileWriter is still async. It dispatches writes asynchronously to this queue. Making self.queue.async {} in this PR would lead to doubling the async call to queue (queue.async { queue.async { /* write */ } }).

But I'm aware of this and this was changed in #330 where queue is used instead of objc_sync. In #330 the FileWriter is changed to be synchronous, which provides simpler threading model.

Base automatically changed from ncreated/RUMM-829-add-consent-aware-data-writer to tracking-consent December 7, 2020 07:30
@ncreated ncreated merged commit 6471e79 into tracking-consent Dec 7, 2020
@ncreated ncreated deleted the ncreated/RUMM-830-add-consent-provider branch December 7, 2020 07:36
@ncreated ncreated mentioned this pull request Dec 16, 2020
2 tasks
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.

2 participants