forked from openwallet-foundation/didcomm-mediator-credo
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: pallavicoder <pallavi.ghule@ayanworks.com>
- Loading branch information
1 parent
5e3ead1
commit 537deaf
Showing
3 changed files
with
25 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ void connect({ | |
process.env.SHORTENER_BASE_URL = `${url}/s` | ||
|
||
require('./src/index') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,30 @@ | ||
|
||
|
||
class SocketIdsManager { | ||
private active_connections : Record<string , unknown> = {} | ||
private active_connections: Record<string, unknown> = {} | ||
|
||
private static instance: SocketIdsManager; | ||
private static instance: SocketIdsManager | ||
|
||
private constructor() {} | ||
private constructor() {} | ||
|
||
public static getInstance() : SocketIdsManager { | ||
if(!SocketIdsManager.instance){ | ||
SocketIdsManager.instance = new SocketIdsManager() | ||
} | ||
return SocketIdsManager.instance; | ||
public static getInstance(): SocketIdsManager { | ||
if (!SocketIdsManager.instance) { | ||
SocketIdsManager.instance = new SocketIdsManager() | ||
} | ||
|
||
public addSocketId(socketId:string) : string { | ||
this.active_connections[socketId] = socketId; | ||
return socketId; | ||
} | ||
|
||
public removeSocketId(socketId : string) : string { | ||
delete this.active_connections[socketId] | ||
return socketId; | ||
} | ||
|
||
public getConnectionBySocketId(socketId : string) : any { | ||
return this.active_connections[socketId] | ||
} | ||
|
||
return SocketIdsManager.instance | ||
} | ||
|
||
public addSocketId(socketId: string): string { | ||
this.active_connections[socketId] = socketId | ||
return socketId | ||
} | ||
|
||
public removeSocketId(socketId: string): string { | ||
delete this.active_connections[socketId] | ||
return socketId | ||
} | ||
|
||
public getConnectionBySocketId(socketId: string): any { | ||
return this.active_connections[socketId] | ||
} | ||
} | ||
|
||
export { SocketIdsManager} | ||
export { SocketIdsManager } |