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

Expose async transaction support in the C API #5783

Merged
merged 6 commits into from
Aug 29, 2022

Conversation

nicola-cab
Copy link
Member

@nicola-cab nicola-cab commented Aug 26, 2022

What, How & Why?

Expose realm support for async transactions in the C API.
Fixes: #5771

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • C-API, if public C++ API changed.

Copy link
Member

@fealebenpae fealebenpae left a comment

Choose a reason for hiding this comment

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

I think we need to change the names. In the C++ Realm class we talk about transactions (begin_transaction, cancel_transaction), but in the C API we talk about writes (realm_begin_write, realm_commit, realm_rollback). I suggest that for consistency's sake we use realm_async_begin_write, realm_async_commit, and realm_async_cancel, or something else that follows the existing terminology in the C API.

src/realm.h Outdated Show resolved Hide resolved
src/realm.h Outdated Show resolved Hide resolved
src/realm.h Outdated Show resolved Hide resolved
src/realm.h Outdated Show resolved Hide resolved
Copy link
Member

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

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

A few more questions from me.

src/realm.h Outdated Show resolved Hide resolved
src/realm.h Outdated Show resolved Hide resolved
@nicola-cab
Copy link
Member Author

@fealebenpae all your comments have been addressed, @nirinchev, if you think that passing the realm in the callback is superfluous, let me know, and I will remove the parameter.

@nicola-cab nicola-cab requested a review from fealebenpae August 26, 2022 16:58
@nirinchev
Copy link
Member

I'm just not sure why we'd need the realm instance in the callback. Supposedly, the caller already has an instance and they can capture that and use in the callback. It's possible I'm missing something though, so just wanted to check if that's the case.

@nicola-cab
Copy link
Member Author

I'm just not sure why we'd need the realm instance in the callback. Supposedly, the caller already has an instance and they can capture that and use in the callback. It's possible I'm missing something though, so just wanted to check if that's the case.

No, I think you are right, let me remove it.

@nicola-cab
Copy link
Member Author

@nirinchev I am about to merge this, are you OK with the changes?

@nicola-cab nicola-cab merged commit 21f67ac into master Aug 29, 2022
@nicola-cab nicola-cab deleted the nc/expose_asyc_transactions_capi branch August 29, 2022 10:14
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C-API: missing write_async API
3 participants