You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make the file-system module run in a background thread [$300] #2239
Calling file-sytem -> writeText is freezing the UI of my apps until the write process is complete. Even the ActivityIndicator freezes during that time.
This is a big issue when saving big chunks of data which can take between 10 to 60 seconds to write.
I have tested it on Android with NativeScript 2.0.1
To solve that it would be great if the write functionality could run in a background thread, just like it is done for the http module.
Here is the scenario where I need to save big chunks of data.
The app I am building uses Lokijs for Offline Storage mechanism, where I store 50k records from different tables. When I call save database, the LokiNativeScriptAdapter uses file-system module to save the data to a file, which takes up to 60 seconds.
Question, is this the same thing as imageSource.setNativeSource() function? I am trying to make a photo library using a forEach method that creates a stack of photos from the iOS Photos library. Problem is that the app freezes until every photo has been rendered in the UI. If I only console.log each photo using the same procedure, the logs come out one by one as opposed to the UI that waits until every photo is loaded.
changed the title [-]Make the file-system module run in a background thread[/-][+]Make the file-system module run in a background thread [$300][/+]on Jul 22, 2019
Activity
NordlingDev commentedon Jun 26, 2016
Question, is this the same thing as
imageSource.setNativeSource()function? I am trying to make a photo library using a forEach method that creates a stack of photos from the iOS Photos library. Problem is that the app freezes until every photo has been rendered in the UI. If I only console.log each photo using the same procedure, the logs come out one by one as opposed to the UI that waits until every photo is loaded.farfromrefug commentedon Oct 17, 2018
I will bump that issue cause i feel it is kind of very big issue in Nativescript.
File are read in the main thread:
https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/file-system/file-system-access.android.ts#L241
Images are read on the main thread:
NativeScript/tns-core-modules/image-asset/image-asset.android.ts
Line 26 in 05c2460
All that makes for a pretty bad navigation experience.
This all should be implemented in in the native lib.
[-]Make the file-system module run in a background thread[/-][+]Make the file-system module run in a background thread [$300][/+]