zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 620 forks source link

How to use Hive.lazyBox #1151

Open vasilich6107 opened 2 years ago

vasilich6107 commented 2 years ago

Describe the solution you'd like During the app functioning the cache could have a lot of data saved. Default HiveBox reads all cache into memory while opening. This could take too much time to wait on application startup. While Store.get method is sync there is no way to use lazy boxes.

Could you clarify if there is any ideas to implement async store to enable using the lazybox or sqllite for better cache performance?

budde377 commented 2 years ago

@vincenzopalazzo sounds like a good candidate for the major release.

vincenzopalazzo commented 2 years ago

Yeah, it is a good point.

I can take a look when I'm back in the office next week!

gd46 commented 2 years ago

Hi, I am wondering if this has gotten any traction or what the recommendation is? I see the referenced story to make the store async was closed.

vincenzopalazzo commented 2 years ago

There is some discussion around it, but I need to find the time to test it, if someone what start to test it PR are welcome

vasilich6107 commented 1 year ago

Hi. Could you provide any updates on this issue?

vincenzopalazzo commented 1 year ago

Hi, sorry but I did not yet had the opportunity to look into it, also there is this discussion that is going on https://github.com/zino-hofmann/graphql-flutter/discussions/1286 maybe would you participate into it and give your opinion?

vasilich6107 commented 1 year ago

Hi @vincenzopalazzo There is a suggestion to support isar lib. This is could be a good addition to the cache management diversity but it does not relates to the current issue) Could you clarify the idea behind looking into isaar instead of making Store.get async?

jaysignorello commented 1 year ago

@vincenzopalazzo While support for isar is good for some folks, seems like rebuilding Store implementation to support async operations would be a good first step for the project. This way Hive.lazyBox, isar, or whatever store someone wants to use could be supported.

We're using Hive at the moment and ran into memory issues because it wasn't immediately clear that Hive places everything into memory unless a developer uses Hive.lazyBox.

vasilich6107 commented 1 year ago

any updates on this?