-
Notifications
You must be signed in to change notification settings - Fork 254
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
Wrap promises and cross contract calls #6
Comments
do we have any plan to work on the futures or async/await syntax? |
This isn't currently feasible with NEAR's async programming model. Rust async primitives assume you can continue to run the current process and poll to return the yielded future type. This is under the assumption that another task/thread will progress this future. This can't be applied here because the future that we would be awaiting is planned to be executed Trying to force this model just for the syntactic familiarity would add confusion and lead to some janky patterns that don't fit well with NEAR's VM. I'd like to hear if someone has an idea on how this can be done cleanly that would be an improvement over what exists. |
Overall Idea - Mutation listeners I have no idea how rust works but instead of async await, intercontract interaction can be based on "before mutate", "after full mutate" and 'on property mutate' In each method in a contract, they have a few dependency lists
Then when a method on the contract is running
It is up to the developer to install the library and cast an address as the desired class though since addresses can just be users. A few issues
But at least this way they don't have to implement some sort of loop. things can just be synchronous |
We need to wrap promises and cross contract calls in some familiar abstractions, e.g. Futures or async/await.
The text was updated successfully, but these errors were encountered: