"Fixed Typos - Will add more in another PR"

This commit is contained in:
Jason Risch committed 2021-10-28 11:23:03 -07:00
1 parent 04082339fc
commit 824843f70f
122 files changed
+395 -395

No files matched your search

+10 -10
View File
@@ -34,7 +34,7 @@
if (eventHandler === undefined) {
/*
We will only create event handlers which were not created before. Remember that someone trying to listen events
at an event handler that does not exist, will create that eventhandler, so it is possible that the emitter
at an event handler that does not exist, will create that event handler, so it is possible that the emitter
when trying to create the event handler in fact was late and the event handler is already there if the listener
arrived here first. An event handler created with this method is not destroyed if there are no listeners or they
all leave.
@@ -50,8 +50,8 @@
let eventHandler = eventHandlers.get(command.eventHandlerName)
if (eventHandler !== undefined) {
/*
We will only delete event handlers which have noone listening, allowing a listener to continue listening even
when the event emitter is gone, asuming that it could come back at some point in time and resume emitting.
We will only delete event handlers which have no one listening, allowing a listener to continue listening even
when the event emitter is gone, assuming that it could come back at some point in time and resume emitting.
*/
if (eventHandler.listeners.length === 0) {
eventHandlers.delete(command.eventHandlerName)
@@ -68,8 +68,8 @@
if (eventHandler === undefined) {
/*
We will create event handlers which were not created before if a listener tries to listen to a handler that does not
exist before the emitter comes and create it. This is to aviod syncronization problems and also problems with emitters life
cycles with higher frecuency that the ones of listeners. Created in this way, event handlers are marked for deletion if
exist before the emitter comes and create it. This is to avoid synchronization problems and also problems with emitters life
cycles with higher frequency that the ones of listeners. Created in this way, event handlers are marked for deletion if
all listeners stop listening at one point in time.
*/
eventHandler = newEventHandler()
@@ -104,7 +104,7 @@
if (eventHandler === undefined) {
/* If the event handler does not exist anymore, then there is no need to perform further actiions. */
/* If the event handler does not exist anymore, then there is no need to perform further actions. */
sendResponse(global.DEFAULT_OK_RESPONSE)
return
}
@@ -112,7 +112,7 @@
eventHandler.stopListening(command.eventHandlerName, command.eventType, command.callerId, command.eventSubscriptionId)
/*
We check here if there are no more listeners and the event handler original emmiter is also gone, then we need to delete
We check here if there are no more listeners and the event handler original emitter is also gone, then we need to delete
this event handlers since chances are that is not needed anymore.
*/
if (eventHandler.listeners.length === 0 && eventHandler.deleteWhenAllListenersAreGone === true) {
@@ -130,7 +130,7 @@
eventHandler = newEventHandler()
eventHandlers.set(command.eventHandlerName, eventHandler)
/* No matter if it is the listener or the emiter the one that acts first, if an event handler does not exist we just create it acan keep it there. */
/* No matter if it is the listener or the emitter the one that acts first, if an event handler does not exist we just create it and keep it there. */
}
//console.log("[INFO] Client -> Events Server -> Raising Event " + command.eventHandlerName + " " + command.eventType)
@@ -163,7 +163,7 @@
let thisObject = {
name: undefined, // This is for debugging purposes only.
deleteWhenAllListenersAreGone: false,
listeners: [], // Here we store all the functions we will call when an event is raiseed.
listeners: [], // Here we store all the functions we will call when an event is raised.
listenToEvent: listenToEvent,
stopListening: stopListening,
raiseEvent: raiseEvent,
@@ -181,7 +181,7 @@
/*
We can not allow to have the exact same listener more than once. In case that we find a listener trying to listen again, the first record will
be deleted and we are just going to consider the last one comming in.
be deleted and we are just going to consider the last one coming in.
*/
for (let i = 0; i < thisObject.listeners.length; i++) {
if (eventHandlerName === thisObject.listeners[i][0] && eventType === thisObject.listeners[i][1] && callerId === thisObject.listeners[i][2]) {