During an intercanister-canister update calls, I understand that its asynchronous but is the process of notifying the canister asynchrounous?
I.e. lets say I have a heartbeat function in my calling canister and I want to trigger a method from another canister from the calling one at the immediate fire of the same heartbeat. Is the process of calling the function immediate like that?
No, your heartbeat will halt and await the return if you use await. That iteration of the heartbeat will pick right back up in another round, so be wary of relying on preloaded state. Check all vars again after the await. Don’t assume that the next heartbeat will have an answer from the other canister.
Oh, I don’t mean in terms of what happens to the calling canister in terms of its variables. I mean is there any delay in block time between the triggering of the called canister’s function.
Now this comes with the my inital assumption that all canisters follow the same heartbeat (maybe I am wrong here).
But actually thats good to know, I had thought the heartbeat kept going because there isnt atomicity when using await. So my question is why should there be any need for the heartbeat to halt? I can see that being an issue with queing if atomic transactions were a thing. But if not, whats the point?
Halt is maybe the wrong word. The program awaits…other things can happen while that is happening. Processing new messages, future round heartbeats, etc.
Oh yea, that makes sense. I intially thought the heartbeat as if something external was continously calling the heartbeat function.,i.e. if the heartbeat function was any other function that was implemented it would be like if you implemented a method with an await in the body, someone could still call that function even while processing the body and it wouldn’t just disregard that second call even if the inital call was processing an await. But I realize, it is literally just one function call its not as if its continously being called.
I’m still wondering then, is the direct triggering of an intercanister call immediate? See, I’m actually not worried about the calling canister, I just wanted to ensure that canister to canister the actual triggering of the called canister is immediate and while the heartbeat funcition may “halt” in the first canister, does it still lie in synchrony with the second when it picks it back up.