From e45d2f728330962bace856f1014a94e25c41077c Mon Sep 17 00:00:00 2001 From: DieMyst Date: Fri, 22 Oct 2021 16:32:45 +0300 Subject: [PATCH] update ttl --- src/examples/callArrowCall.ts | 2 +- src/examples/closures.ts | 12 ++++++++++++ src/examples/coCall.ts | 2 +- src/examples/foldCall.ts | 4 ++-- src/examples/tryCatchCall.ts | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 src/examples/closures.ts diff --git a/src/examples/callArrowCall.ts b/src/examples/callArrowCall.ts index 3a2c2b8..f99929b 100644 --- a/src/examples/callArrowCall.ts +++ b/src/examples/callArrowCall.ts @@ -8,6 +8,6 @@ export async function callArrowCall(): Promise { let result = 'Hello, ' + a + '!'; resolve(result); return result; - }); + }, {ttl: 10000}); }); } diff --git a/src/examples/closures.ts b/src/examples/closures.ts new file mode 100644 index 0000000..7abdb76 --- /dev/null +++ b/src/examples/closures.ts @@ -0,0 +1,12 @@ +import { Fluence } from '@fluencelabs/fluence'; +// import { smth, registerLocalSrv } from '../compiled/examples/closures'; +import { relays } from '../config' + +export async function closuresCall() { + const relayPeerId = Fluence.getPeer().getStatus().relayPeerId; + const selfPeerId = Fluence.getPeer().getStatus().peerId; + + // registerLocalSrv({inside: () => console.log("call inside")}) + + // return smth(relays[2].peerId, relays[3].peerId) +} \ No newline at end of file diff --git a/src/examples/coCall.ts b/src/examples/coCall.ts index f86e1d2..ae8378c 100644 --- a/src/examples/coCall.ts +++ b/src/examples/coCall.ts @@ -14,6 +14,6 @@ export async function coCall(): Promise { return new Promise((resolve, reject) => { parFunc(relayPeerId, (c) => { resolve(c.external_addresses); - }); + }, {ttl: 10000}); }); } diff --git a/src/examples/foldCall.ts b/src/examples/foldCall.ts index d1733d2..234e445 100644 --- a/src/examples/foldCall.ts +++ b/src/examples/foldCall.ts @@ -4,12 +4,12 @@ import { iterateAndPrint, iterateAndPrintParallel } from '../compiled/examples/f export async function foldCall() { const relayPeerId = Fluence.getPeer().getStatus().relayPeerId; - await iterateAndPrint([relayPeerId]); + await iterateAndPrint([relayPeerId], {ttl: 10000}); return new Promise((resolve, reject) => { iterateAndPrintParallel([relayPeerId], (c) => { console.log('iterateAndPrintParallel. external addresses: ' + c.external_addresses); resolve(c.external_addresses); - }); + }, {ttl: 10000}); }); } diff --git a/src/examples/tryCatchCall.ts b/src/examples/tryCatchCall.ts index f2fa8f4..761bb25 100644 --- a/src/examples/tryCatchCall.ts +++ b/src/examples/tryCatchCall.ts @@ -3,5 +3,5 @@ import { tryCatchTest } from '../compiled/examples/tryCatch'; export async function tryCatchCall(): Promise { const relayPeerId = Fluence.getPeer().getStatus().relayPeerId; - return await tryCatchTest(relayPeerId); + return await tryCatchTest(relayPeerId, {ttl: 10000}); }