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

Only execute job when network is available #55

Open
hannojg opened this issue Sep 30, 2019 · 8 comments
Open

Only execute job when network is available #55

hannojg opened this issue Sep 30, 2019 · 8 comments

Comments

@hannojg
Copy link

hannojg commented Sep 30, 2019

Hey!
Do we have a mechanism to only execute jobs once there is network connectivity? Which also means keeping jobs in the queue as long as the network is unavailable.

I wasn't able to find something from a quick look.
If not, can you point me where I could start implementing @billmalarky

Thank you so much!

@vishgoel007
Copy link

Hi, did you able to find any solution ?

@hannojg
Copy link
Author

hannojg commented Nov 4, 2019

No, but I am still interested in an solution!

@vishgoel007
Copy link

vishgoel007 commented Nov 4, 2019

I think we can actually implement that in library but sadly author is not responding at all.

@rdgomt
Copy link

rdgomt commented Nov 5, 2019

I've been trying to implement this functionality using @react-native-community/netinfo. I'll let you know if I get this done.

@vishgoel007
Copy link

@rdgomt Is there any solution for this issue too.

@vishgoel007
Copy link

@rdgomt If you haven't implemented that functionality yet, can you guide my how can i do this?
I'm thinking about using rxjs for that.

@gruffT
Copy link

gruffT commented Nov 17, 2019

You can impliment this outside of the library. Add a NetInfo listener and start / stop the queue on network state change.
NetInfo.addEventListener(state => { if (state.isInternetReachable) { logger.log('Network connection up, starting queue.'); this.queue.start(); } else { logger.log('Network connection down, stopping queue.'); this.queue.stop(); } });

@rdgomt
Copy link

rdgomt commented Nov 18, 2019

@vishgoel007 I don't know rxjs, but you can use either NetInfo directly or react-native-offline.

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

4 participants