Skip to content

Commit

Permalink
event done
Browse files Browse the repository at this point in the history
  • Loading branch information
Snafkin547 committed Jun 7, 2024
1 parent dcfa674 commit 4877adf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/client/api/initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function (jiffClient) {
}

jiffClient.wait_callbacks.push({ parties: parties, callback: callback, initialization: wait_for_initialization });
jiffClient.socketEvents.execute_wait_callbacks(); // See if the callback can be executed immediately
jiffClient.socketEvent.execute_wait_callbacks(); // See if the callback can be executed immediately
};

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/client/handlers/initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ module.exports = function (jiffClient) {
}

// Resolve any pending messages that were received before the sender's public key was known
jiffClient.socketEvents.resolve_messages_waiting_for_keys();
jiffClient.socketEvent.resolve_messages_waiting_for_keys();

// Resolve any pending waits that have satisfied conditions
jiffClient.socketEvents.execute_wait_callbacks();
jiffClient.socketEvent.execute_wait_callbacks();

// Check if all keys have been received
if (jiffClient.keymap['s1'] == null) {
Expand Down
6 changes: 3 additions & 3 deletions lib/jiff-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const counters = require('./client/arch/counters.js');
// socket and events
const GuardedSocket = require('./client/socket/mailbox.js');
const internalSocket = require('./client/socket/internal.js');
const SocketEvents = require('./client/socket/events.js');
const SocketEvent = require('./client/socket/events.js');

// handlers for communication
const handlers = require('./client/handlers.js');
Expand Down Expand Up @@ -445,12 +445,12 @@ function JIFFClient(hostname, computation_id, options) {
}

// Add socket event handlers as socketEvents
this.socketEvents = new SocketEvents(JIFFClientInstance);
this.socketEvent = new SocketEvent(JIFFClientInstance);

// set up socket event handlers
handlers(JIFFClientInstance);

JIFFClientInstance.socketEvents.initSocket();
JIFFClientInstance.socketEvent.initSocket();

JIFFClientInstance.socket.connect();
};
Expand Down

0 comments on commit 4877adf

Please sign in to comment.