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

Enable users to choose which dispatchers to use for Client and Document #153

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

skhugh
Copy link
Contributor

@skhugh skhugh commented Jan 23, 2024

What this PR does / why we need it?

Enabled users to choose which dispatcher to use for Client and Document, rather than using a fixed single-threaded dispatcher.

Any background context you want to provide?

While applying Yorkie to a text editor it was found that using a background thread for document updates could cause problems as users can input text while remote changes for document are being applied.
It is very hard to control Android's text input as it is mostly controlled by Android framework, therefore using a main thread for document updates should be recommended.
But for usecases where developer can control the sequence of data changes in detail, using a background thread can still be advantageous.

I also changed Client and Doucment to Closeable as default single-thread dispatcher should be closed.

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

@skhugh skhugh self-assigned this Jan 23, 2024
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (47b2323) 79.62% compared to head (6b6f0a4) 79.62%.

Files Patch % Lines
yorkie/src/main/kotlin/dev/yorkie/core/Client.kt 85.71% 0 Missing and 1 partial ⚠️
...ie/src/main/kotlin/dev/yorkie/document/Document.kt 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
- Coverage   79.62%   79.62%   -0.01%     
==========================================
  Files          63       63              
  Lines        3843     3852       +9     
  Branches      601      603       +2     
==========================================
+ Hits         3060     3067       +7     
  Misses        459      459              
- Partials      324      326       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Co-authored-by: Jeehyun Kim <jee_hyun.kim@navercorp.com>
@skhugh skhugh merged commit 0c12299 into yorkie-team:main Jan 23, 2024
6 checks passed
@skhugh skhugh changed the title Enable users to choose which dispatchers for Client and Document Enable users to choose which dispatchers to use for Client and Document Jan 23, 2024
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