-
Hey there! I'm trying out Stakker to see whether it'll fit with a hybrid cloud simulator of mine. Two things I'd like to implement are:
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
To return a value to the caller, pass a You can set up timers or timeouts using Note that if you wish to run in virtual time, then the time used by Have a look at the docs for the things I mentioned, and if it isn't clear ask further. |
Beta Was this translation helpful? Give feedback.
To return a value to the caller, pass a
Ret
instance in the call. Then the called method can pass back a value using theret!
macro on thatRet
instance. This could be later on, e.g. it could store theRet
somewhere and return a value later when some calculation has completed (or whatever). There is a brief example in the docs -- in particular the call to query:let ret = ret_some_to!([cx], recv_state(self.count) as (bool)); call!([self.light], query(ret));
. Theret_to!
andret_some_to!
macros do the job of creating aRet
to return the data to the caller. They can either return to a local method of the caller (may be private) or to inline code. So theRet
is like an asynchronous callback,…