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

React-native-queue + react-native-background-upload for a bunch of file uploads #29

Open
otaviogaiao opened this issue Jun 30, 2018 · 9 comments

Comments

@otaviogaiao
Copy link

Hi. I'm using your lib in my new app, and I have some questions that I hope someone here can help me with.

In my app, I have a "sync" routine, where I make many api calls sequencially. Each api call is a file that I'm sending. For that I'm thinking about using react-native-background-upload, since the upload has to continue if the app goes into background.

I'm using your lib to make a queue of files to send. So my logic is the following:

Create queue()
AddWorker()
for(file of files) {
  createJob(file)
}

On success of each file, I'm updating my database and redux store (Not sure If I can do that in a job).

Reading your docks, I'm unsure if your lib will keep executing one job after the other in background, or If I have to use it along with another lib, such as background tasks.

I tried to experiment creating a dozen jobs that just wait 5 seconds and print something on the screen. When I went into background, they paused, nothing was appearing on the screen.

Could someone clarify that for me? Thanks!!!

@billmalarky
Copy link
Owner

billmalarky commented Jul 2, 2018 via email

@otaviogaiao
Copy link
Author

Nice man, It helped a lot! Thank you so much!

@otaviogaiao
Copy link
Author

Oh one more question. Is there any way to tell the queue a job ended? Because the file upload is being made in a service or something like that. So the queue invokes the upload and think its over, so it goes to the next one.

@billmalarky
Copy link
Owner

billmalarky commented Jul 4, 2018 via email

@otaviogaiao
Copy link
Author

Thank you man! I will try that.

@billmalarky
Copy link
Owner

billmalarky commented Jul 4, 2018 via email

@OB-dev-mobility
Copy link

OB-dev-mobility commented Jun 27, 2019

Hi, I used the same logic of @otaviogaiao, but I can not make the API call sequentially. In fact I want to make the API call sequential.

Could someone clarify that for me? Thanks!!!

@OB-dev-mobility
Copy link

ping @billmalarky

@OB-dev-mobility
Copy link

ping @otaviogaiao

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

No branches or pull requests

3 participants