2021-12-29 12:01:13 +03:00
|
|
|
service HelloWorld("hello-srv"):
|
|
|
|
hello: string -> string
|
2021-12-22 15:21:37 +03:00
|
|
|
|
2022-01-13 13:39:43 +03:00
|
|
|
data Info:
|
|
|
|
external: []string
|
|
|
|
|
|
|
|
func sayHello(info: Info) -> string:
|
2021-12-29 12:01:13 +03:00
|
|
|
-- execute computation on a Peer in the network
|
|
|
|
on "hello-peer":
|
2022-01-13 13:39:43 +03:00
|
|
|
comp <- HelloWorld.hello(info.external!)
|
2021-12-22 15:21:37 +03:00
|
|
|
|
2021-12-29 12:01:13 +03: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 15:21:37 +03:00
|
|
|
|
2022-01-13 13:58:20 +03:00
|
|
|
join comp
|
|
|
|
|
2021-12-29 12:01:13 +03:00
|
|
|
-- send the result to the initiator
|
|
|
|
<- comp
|