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

How to set timeout #25

Closed
Enoooch opened this issue Mar 26, 2019 · 5 comments
Closed

How to set timeout #25

Enoooch opened this issue Mar 26, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@Enoooch
Copy link

Enoooch commented Mar 26, 2019

Error:Can't setup.The previous request is still running.
I have several local IP address to ping, if one down, others are down too.
new feature request:
await Ping.start('192.168.1.111', { timeout: 1500 })

@RoJoHub RoJoHub added the enhancement New feature or request label Mar 26, 2019
@RoJoHub
Copy link
Owner

RoJoHub commented Mar 26, 2019

This api is not open yet. But it may be released tonight.

@Enoooch
Copy link
Author

Enoooch commented Mar 26, 2019

OK, is there any link about this update?

And is there any way to stop the promise manually?
let res = Ping.start('192.168.1.111')
res.reject()

Have to stop the promise manually, because the process is too long.

@RoJoHub
Copy link
Owner

RoJoHub commented Mar 26, 2019

Maybe you should use async/await?

    setTimeout(async () => {
      try {
        const ms = await Ping.start('114.114.114.114');
      } catch (error) {
        console.log('something happened', error);
      }
    }, 1000);

If any update,i will push to github and npm.

@Enoooch
Copy link
Author

Enoooch commented Mar 26, 2019

Thanks. I'll wait, but setTimeout is still not a solution.

@RoJoHub
Copy link
Owner

RoJoHub commented Mar 29, 2019

Please update to 1.2.0.
This feature has been added in version 1.2.0.

@RoJoHub RoJoHub closed this as completed Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants