mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2024-12-05 02:10:18 +00:00
Immediate -> timeout (#14)
This commit is contained in:
parent
4276ea7c2e
commit
e4d3f688ed
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fluencelabs/fluence",
|
||||
"version": "0.9.3",
|
||||
"version": "0.9.9",
|
||||
"description": "JS SDK for the Fluence network",
|
||||
"main": "./dist/index.js",
|
||||
"typings": "./dist/index.d.ts",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { FluenceClient } from './FluenceClient';
|
||||
import { SecurityTetraplet } from './internal/commonTypes';
|
||||
import { genUUID, Particle } from './internal/particle';
|
||||
import { Particle } from './internal/particle';
|
||||
import Multiaddr from 'multiaddr';
|
||||
import PeerId, { isPeerId } from 'peer-id';
|
||||
import { generatePeerId, seedToPeerId } from './internal/peerIdUtils';
|
||||
@ -106,9 +106,9 @@ export const subscribeToEvent = (
|
||||
): Function => {
|
||||
const realHandler = (args: any[], tetraplets: SecurityTetraplet[][]) => {
|
||||
// dont' block
|
||||
setImmediate(() => {
|
||||
setTimeout(() => {
|
||||
handler(args, tetraplets);
|
||||
});
|
||||
}, 0);
|
||||
|
||||
return {};
|
||||
};
|
||||
|
@ -138,10 +138,10 @@ export class FluenceClientImpl extends FluenceClientBase implements FluenceClien
|
||||
const executingParticlePromiseFns = this.fetchParticles.get(fnName);
|
||||
if (executingParticlePromiseFns) {
|
||||
// don't block
|
||||
setImmediate(() => {
|
||||
setTimeout(() => {
|
||||
this.fetchParticles.delete(fnName);
|
||||
executingParticlePromiseFns.resolve(args);
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
|
||||
return {
|
||||
@ -170,12 +170,12 @@ export class FluenceClientImpl extends FluenceClientBase implements FluenceClien
|
||||
}
|
||||
|
||||
// don't block
|
||||
setImmediate(() => {
|
||||
setTimeout(() => {
|
||||
this.pushEvent(serviceId, {
|
||||
type: fnName,
|
||||
args: args,
|
||||
});
|
||||
});
|
||||
}, 0);
|
||||
|
||||
return {
|
||||
ret_code: 0,
|
||||
|
Loading…
Reference in New Issue
Block a user