Services
service
serviceservice Peer("peer"):
foo() -- no arguments, no return
bar(i: bool) -> bool
func usePeer() -> bool:
Peer.foo() -- results in a call of service "peer", function "foo", on current peer ID
z <- Peer.bar(true)
<- zservice MyService:
foo()
bar(i: bool, z: i32) -> string
func useMyService(k: i32) -> string:
-- Need to tell the compiler what does "my service" mean in this scope
MyService "my service id"
MyService.foo()
on "another peer id":
-- Need to redefine MyService in scope of this peer as well
MyService "another service id"
z <- MyService.bar(false, k)
<- zLast updated
Was this helpful?