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

Timeout when downloading initial data #6247

Closed
cmelchior opened this issue Oct 23, 2018 · 0 comments
Closed

Timeout when downloading initial data #6247

cmelchior opened this issue Oct 23, 2018 · 0 comments
Assignees

Comments

@cmelchior
Copy link
Contributor

When using synchronized Realms you can specify

user.createConfiguration(url)
  .waitForInitialRemoteData()
  .build();

This means the Realm will not be opened before any relevant server data has been fully downloaded. In cases of poor/no network this can, however, take quite a lot of time. In those cases, a user might want to abort and do something else.

The download will react to either calling Thread.interrupt() or RealmAsyncTask.cancel(), but it is rather manual and annoying to have to implement timing yourself.

Instead, we should make it possible to define a timeout parameter that will abort automatically, like:

user.createConfiguration(url)
  .waitForInitialRemoteData(5, Timeunit.SECONDS)
  .build();

This is also related to #6073

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants