Conversation
Contributor
Author
|
先就这样写了,这个东西同一个DelphinusContract 因为SetTimeout的handler是一个Process的全局变量,但是不改接口没法把handler id定义在Monitor的main里。 这块不知道有没有办法再不改接口的情况下能够一个process只存一套timeoutHandlerDict和timeOutId |
Contributor
Author
|
不对,我放在了class的static里,理论上就是全局的了。。。。不过不知道javascript的实现是不是符合。 |
igerry
reviewed
Mar 23, 2022
src/client.ts
Outdated
| }); | ||
|
|
||
| // returns a race between timeout and the passed promise | ||
| return Promise.race<T>([promise, timeoutPromise]); |
There was a problem hiding this comment.
suggested change:
return Promise.race([promise, timeoutPromise]).then({ (value) ==> clearTimeout(timeoutHandler)})
Contributor
Author
|
已改完 |
igerry
approved these changes
Mar 23, 2022
|
|
||
| // returns a race between timeout and the passed promise | ||
| return Promise.race<T>([promise, timeoutPromise]) | ||
| .then( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add a function to add timeout functionality for call web3 api.