• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Writing in app-storage directory inside Worker

Explorer ,
Jan 06, 2016 Jan 06, 2016

Copy link to clipboard

Copied

Hi there,

In my Adobe AIR app (desktop), I wrote a FileDownloader class that use insternally a FileStream instance to write remote files into the application storage directory

The problem is that the UI freezes during the download process (even though i opened the local file asynchronously)

As a workaround, I thought it could be a good idea to use a Worker to download those files, but when I try to write them inside the app-storage directory from my Worker thread,

the Worker writes it in this folder : %appdata%\[Worker].null\Local Store

As you can see, the app-storage directory is inside this folder named "[Worker].null"  instead of being in my real app-storage dir (named by my app identifier)

A solution I found is to write the downloaded files to a tmp file, and then, in the main Worker Thread, use moveToAsync to move the file to my app-storage directory, but it's not very clean... and moveToAsync takes time with large files...

Anyone has experienced this issue?

Is it the normal behavior or is it a bug? I think the Worker should have the same app-storage directory as the application that embed it (especially when you set giveAppPrivileges=true in createWorker method)

Thanks

(and sorry for my english)

TOPICS
Performance issues

Views

741

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jan 20, 2016 Jan 20, 2016

Hi,

Having worked with multiple Workers on my own project, I have experienced the very same behaviour.

The solution I found was to set a shared property on the worker, with the native path of the app.

So, on the primordial worker, you get the applicationStorageDirectory native path, and then set the shared property on the worker.

hope it helps.

regards,

Leo

Votes

Translate

Translate
Explorer ,
Jan 20, 2016 Jan 20, 2016

Copy link to clipboard

Copied

Hi,

Having worked with multiple Workers on my own project, I have experienced the very same behaviour.

The solution I found was to set a shared property on the worker, with the native path of the app.

So, on the primordial worker, you get the applicationStorageDirectory native path, and then set the shared property on the worker.

hope it helps.

regards,

Leo

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 21, 2016 Jan 21, 2016

Copy link to clipboard

Copied

Awesome, I didn't think about that

Thanks a lot

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 21, 2016 Jan 21, 2016

Copy link to clipboard

Copied

LATEST

But I do agree with you, that all workers should share the same keyword based folders.

In the end: applicationStorageDirectory refers to the Application, and your Worker is part of the Application.

To me, all Workers should point to the same path if using such "magic paths".

chris.campbell‌ - perhaps you could check it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines