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

Add messageQueueLeft() method to ExperimentalInternetComputer #554

Open
iclighthouse opened this issue Apr 24, 2023 · 2 comments
Open

Add messageQueueLeft() method to ExperimentalInternetComputer #554

iclighthouse opened this issue Apr 24, 2023 · 2 comments

Comments

@iclighthouse
Copy link

Due to the Message Queue Limit on subnets and canisters, the operation of the contract will be blocked. But the developer can't know when this limit is triggered by the code. So it is suggested to add messageQueueLeft() method to ExperimentalInternetComputer.

messageQueueLeft : () -> { subnet: Nat; canister: Nat }

This would allow application scenarios like the following:

if (ExperimentalInternetComputer.messageQueueLeft().subnet < 100 or ExperimentalInternetComputer.messageQueueLeft().canister < 10) {
    throw Error.reject("Network is busy!");
};
@crusso
Copy link
Contributor

crusso commented Apr 25, 2023

Unfortunately, as far as I know, there's no way for us to implement that without further support from the replica/IC System API.

@iclighthouse
Copy link
Author

Thank you for your reply! IC exposing some key information to Canister will help developers better control the business logic, and hopefully the dfinity foundation will move forward with this internally.

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

2 participants