1
0
mirror of https://github.com/fluencelabs/aqua-playground synced 2025-07-30 09:22:15 +00:00

add and update examples

This commit is contained in:
DieMyst
2021-07-23 11:57:44 +03:00
parent e1ad9917cb
commit 0bf0ba6d94
31 changed files with 215 additions and 137 deletions

@@ -3,7 +3,7 @@
* This file is auto-generated. Do not edit manually: changes may be erased.
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* Aqua version: 0.1.8-SNAPSHOT
* Aqua version: 0.1.9-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
@@ -58,7 +58,7 @@ export async function helloWorld(client: FluenceClient, name: string, config?: {
.handleTimeout(() => {
reject('Request timed out for helloWorld');
})
if(config?.ttl) {
if(config && config.ttl) {
r.withTTL(config.ttl)
}
request = r.build();
@@ -105,7 +105,7 @@ export async function print(client: FluenceClient, str: string, config?: {ttl?:
.handleTimeout(() => {
reject('Request timed out for print');
})
if(config?.ttl) {
if(config && config.ttl) {
r.withTTL(config.ttl)
}
request = r.build();
@@ -159,7 +159,7 @@ export async function testFunc(client: FluenceClient, config?: {ttl?: number}):
.handleTimeout(() => {
reject('Request timed out for testFunc');
})
if(config?.ttl) {
if(config && config.ttl) {
r.withTTL(config.ttl)
}
request = r.build();
@@ -191,103 +191,91 @@ export async function doStuff(client: FluenceClient, a: string, b: string, c: bo
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "a") [] a)
)
(call %init_peer_id% ("getDataSrv" "b") [] b)
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "a") [] a)
)
(call %init_peer_id% ("getDataSrv" "c") [] c)
(call %init_peer_id% ("getDataSrv" "b") [] b)
)
(call %init_peer_id% ("getDataSrv" "d") [] d)
(call %init_peer_id% ("getDataSrv" "c") [] c)
)
(call %init_peer_id% ("getDataSrv" "e") [] e)
(call %init_peer_id% ("getDataSrv" "d") [] d)
)
(call %init_peer_id% ("getDataSrv" "g") [] g)
(call %init_peer_id% ("getDataSrv" "e") [] e)
)
(call %init_peer_id% ("getDataSrv" "str") [] str)
(call %init_peer_id% ("getDataSrv" "g") [] g)
)
(call %init_peer_id% ("getDataSrv" "str") [] str)
)
(par
(par
(par
(seq
(seq
(call %init_peer_id% ("some-id" "t") [str] $stream)
(call -relay- ("op" "noop") [])
)
(call b ("op" "noop") [])
)
(call %init_peer_id% ("println-service-id" "print") [a])
)
(seq
(call -relay- ("op" "noop") [])
(xor
(call a ("peer" "identify") [])
(seq
(seq
(seq
(call %init_peer_id% ("some-id" "t") [str] $stream)
(call -relay- ("op" "noop") [])
)
(call a ("op" "noop") [])
)
(call b ("op" "noop") [])
)
(call %init_peer_id% ("println-service-id" "print") [a])
)
(seq
(call -relay- ("op" "noop") [])
(xor
(call a ("peer" "identify") [])
(seq
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
(call -relay- ("op" "noop") [])
)
)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(seq
(seq
(call -relay- ("op" "noop") [])
(call a ("op" "noop") [])
)
(xor
(match c true
(xor
(match d true
(xor
(fold e eEl
(seq
(seq
(fold g gEl
(seq
(seq
(call b ("some-id" "t") [gEl] $stream)
(call b ("some-id" "t") [eEl] $stream)
)
(next gEl)
)
)
(call b ("some-id" "t") [eEl] $stream)
)
(next eEl)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(seq
(call -relay- ("op" "noop") [])
(xor
(match c true
(xor
(match d true
(xor
(fold e eEl
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
(seq
(fold g gEl
(seq
(seq
(call b ("some-id" "t") [gEl] $stream)
(call b ("some-id" "t") [eEl] $stream)
)
(next gEl)
)
)
(call b ("some-id" "t") [eEl] $stream)
)
(next eEl)
)
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
(null)
)
(null)
)
(null)
)
(null)
)
(seq
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
(call -relay- ("op" "noop") [])
)
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
)
(call a ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
@@ -329,7 +317,7 @@ h.on('getDataSrv', 'str', () => {return str;});
.handleTimeout(() => {
reject('Request timed out for doStuff');
})
if(config?.ttl) {
if(config && config.ttl) {
r.withTTL(config.ttl)
}
request = r.build();