-
Notifications
You must be signed in to change notification settings - Fork 159
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
Clarification on Background Tasks #42
Comments
Yes any job that is processed in a background task is limited to at most 30
seconds of execution, so the upload would need to complete during that
time. If you can't complete the upload in that time limit you will have to
get creative. For example you can do something like break the upload into
chunks and reassemble on the backend (ie if a large video file takes 2
minutes to upload then break it up into 6 jobs that each upload 1/6 video
in 20 seconds and then stitch back together on backend). Realistically you
prob want to limit the job to 25 seconds and if it times out for some
reason at least you have 5 seconds to handle that error case gracefully -
if you hit the hard OS enforced timeout I don't think your code will get a
chance to handle the timeout gracefully I suspect iOS will just kill the
process.
Note that this is an operating system limitation (specifically iOS if I
recall correctly), it's not a limitation related to react-native-queue
specific code or anything like that.
React-native-queue is agnostic and can integrate with just about anything,
so sure there's no reason to feel limited to the packages that I integrate
with in my examples, they are just there to help people wrap their heads
around how RNQ can be integrated into anything. That said I suspect
react-native-threads will run indefinitely so long as your app is in *focus*,
it may not run at all when your app is not in focus (which is what
the "react-native-background-task" library will do). As such I'm not sure
react-native-threads will accomplish what you need (if what you need truly
is background job processing ie when your app is running but the user isn't
actively interacting with it).
…On Wed, Jan 2, 2019 at 4:58 PM Justin Lane ***@***.***> wrote:
Hello,
Just looking at your lib for queue and upload of images/videos and have a
question about what you said in #29
<#29>:
The main thing is remember background tasks are limited to ~30 seconds
cross platform so ensure your job can complete in that time frame (or break
it up into separate tasks).
Does this mean that the upload would need to complete in this timeframe,
or is it just that the job in the queue would need to be kicked off? I'm
assuming the former but thought I'd check.
In this case, https://github.com/joltup/react-native-threads might be a
better choice to work with your lib.. .as it doesn't seem to have the 30
second restriction?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABxTU4Pj3UFoSJScxBVl5PJIoMWNLtUAks5u_StsgaJpZM4ZnSiA>
.
|
Wow! Thanks for the speedy, detailed response. I shall close this out now as you've answered my questions and exceeded my expectations with your answer. 💯 ⭐ |
Haha thank you!
…On Wed, Jan 2, 2019 at 5:32 PM Justin Lane ***@***.***> wrote:
Closed #42 <#42>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABxTUzIixqunXIYnCHn1BsmP-xC-UrgDks5u_TN2gaJpZM4ZnSiA>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Just looking at your lib for queue and upload of images/videos and have a question about what you said in #29:
Does this mean that the upload would need to complete in this timeframe, or is it just that the job in the queue would need to be kicked off? I'm assuming the former but thought I'd check.
In this case, https://github.com/joltup/react-native-threads might be a better choice to work with your lib.. .as it doesn't seem to have the 30 second restriction?
The text was updated successfully, but these errors were encountered: