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

Migrate to kotlinx-io #116

Merged
merged 16 commits into from
Aug 14, 2024
Merged

Migrate to kotlinx-io #116

merged 16 commits into from
Aug 14, 2024

Conversation

xxfast
Copy link
Owner

@xxfast xxfast commented Aug 14, 2024

Builds on top of @mani1232's #112

  • Update deps and migrate from okio to kotlinx.io
  • Update example
  • Support for other formats (Will be added in the future)
  • Ignore kotlin metadata
  • Bump yarn lock for kotlin 2.0
  • Fix kstore file tests
  • Bump api
  • Prepare for snapshot 0.9.0
  • Fix kover code coverage reports
  • Fix github action for kover coverage report
  • Downgrade to kotlin 2.0.10
  • Remove kstore formats
  • Add factory method for custom codecs
  • Update documentation

@xxfast xxfast self-assigned this Aug 14, 2024
@xxfast xxfast marked this pull request as ready for review August 14, 2024 07:32
@xxfast
Copy link
Owner Author

xxfast commented Aug 14, 2024

Hi @mani1232 & @8cAyqpVKio

I've added a new overloaded factory method that lets you provide a custom codec (if you want your custom file format) so this should theoretically let you use a format other than JSON)

Again, this is out of scope for now but should unblock anyone who wants to use other unstable serialiser formats

@mani1232
Copy link
Contributor

I have a couple questions:
Does it make sense to save not immediately, but every X minutes?
image
And will it be possible to set your own compression algorithm
image

@xxfast
Copy link
Owner Author

xxfast commented Aug 14, 2024

Do you mean to schedule the writes to the disk?

KStore API for writes/reads all suspended so that it will block whichever coroutine it is invoked from. This is by design.

There's couple advantages for this approach

  • This lets the call-site handle exceptions inline. This wouldn't be possible with exceptions thrown from scheduled tasks
  • This approach preserves the write-order. (as demonstrated in this unit test)

However, any asynchronous behaviour can still be implemented on top of this - with coroutines.

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