Skip to content

flush events when user changes#19

Merged
ajwootto merged 3 commits intomainfrom
DVC-1831-flush-events-automatically
Jan 5, 2022
Merged

flush events when user changes#19
ajwootto merged 3 commits intomainfrom
DVC-1831-flush-events-automatically

Conversation

@ajwootto
Copy link
Copy Markdown
Contributor

@ajwootto ajwootto commented Dec 23, 2021

  • flush events every time identity changes
  • record copy of user with associated events in an outbound "UserAndEvents" queue
  • use coroutines to flush each outbound payload and remove from queue on success or non-retryable error
  • keep payload in queue in retryable error case so it will be retried on next flush
  • add thread safety for events queues

@ajwootto ajwootto force-pushed the DVC-1831-flush-events-automatically branch from bd2abda to 2f445b4 Compare December 23, 2021 23:15
@ajwootto ajwootto requested a review from jsalaber December 24, 2021 15:02
Copy link
Copy Markdown
Contributor

@jsalaber jsalaber left a comment

Choose a reason for hiding this comment

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

Don't know if this is ready yet but it looks good to me so far! will approve when ready for review

@ajwootto ajwootto force-pushed the DVC-1845-coroutines branch 3 times, most recently from 30c21d2 to 0650b5f Compare January 4, 2022 19:46
Base automatically changed from DVC-1845-coroutines to main January 4, 2022 19:46
@ajwootto ajwootto force-pushed the DVC-1831-flush-events-automatically branch from 2f445b4 to 3713b91 Compare January 4, 2022 19:59

if (eventsToFlush.size == 0) {
Log.i(TAG, "No events to flush.")
return@coroutineScope
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should there be a space after return?

@ajwootto ajwootto force-pushed the DVC-1831-flush-events-automatically branch from 3713b91 to f45463e Compare January 5, 2022 17:06
@ajwootto ajwootto force-pushed the DVC-1831-flush-events-automatically branch from f45463e to 1253279 Compare January 5, 2022 18:01
@ajwootto ajwootto marked this pull request as ready for review January 5, 2022 18:02
@ajwootto ajwootto merged commit aee6753 into main Jan 5, 2022
@ajwootto ajwootto deleted the DVC-1831-flush-events-automatically branch January 5, 2022 19:54
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