2021-12-29 09:01:13 +00:00
|
|
|
service HelloWorld("hello-srv"):
|
|
|
|
hello: string -> string
|
2021-12-22 12:21:37 +00:00
|
|
|
|
2022-01-13 10:39:43 +00:00
|
|
|
data Info:
|
|
|
|
external: []string
|
|
|
|
|
|
|
|
func sayHello(info: Info) -> string:
|
2021-12-29 09:01:13 +00:00
|
|
|
-- execute computation on a Peer in the network
|
|
|
|
on "hello-peer":
|
2022-01-13 10:39:43 +00:00
|
|
|
comp <- HelloWorld.hello(info.external!)
|
2021-12-22 12:21:37 +00:00
|
|
|
|
2021-12-29 09:01:13 +00:00
|
|
|
-- send the result to target browser in the background
|
|
|
|
co on "target-peer" via "target-relay":
|
|
|
|
res <- HelloWorld.hello(%init_peer_id%)
|
2021-12-22 12:21:37 +00:00
|
|
|
|
2022-01-13 10:58:20 +00:00
|
|
|
join comp
|
|
|
|
|
2021-12-29 09:01:13 +00:00
|
|
|
-- send the result to the initiator
|
|
|
|
<- comp
|