|
@@ -16,7 +16,7 @@ let targetserver: string = 'localhost:3001'
|
|
let targetserver2: string = 'localhost:3002'
|
|
let targetserver2: string = 'localhost:3002'
|
|
let hostServer: string = 'localhost:3000'
|
|
let hostServer: string = 'localhost:3000'
|
|
let array: any[] = [] // Used for testing
|
|
let array: any[] = [] // Used for testing
|
|
-let intervalToStreamOutGoingMessage: number = 1
|
|
|
|
|
|
+let intervalToStreamOutGoingMessage: number = 15
|
|
|
|
|
|
|
|
|
|
/* Simple Test: 1 to 1 */
|
|
/* Simple Test: 1 to 1 */
|
|
@@ -178,24 +178,25 @@ generateFakeMessagesToBePublished.subscribe({
|
|
id: hostServer,
|
|
id: hostServer,
|
|
message: message
|
|
message: message
|
|
}
|
|
}
|
|
- connectionRequest1.server!.messageToBePublishedFromApplication.next(payload)
|
|
|
|
- connectionRequest2.server!.messageToBePublishedFromApplication.next(payload)
|
|
|
|
|
|
+ // connectionRequest1.server!.messageToBePublishedFromApplication.next(payload)
|
|
|
|
+ // connectionRequest2.server!.messageToBePublishedFromApplication.next(payload)
|
|
},
|
|
},
|
|
error: error => console.error(error),
|
|
error: error => console.error(error),
|
|
complete: () => console.log(`Completed`)
|
|
complete: () => console.log(`Completed`)
|
|
})
|
|
})
|
|
|
|
|
|
-// let generateFakeMessagesToBePublished = stream().pipe(take(10))
|
|
|
|
-// generateFakeMessagesToBePublished.subscribe({
|
|
|
|
-// next: message => {
|
|
|
|
-// let payload: Message = {
|
|
|
|
-// id: hostServer,
|
|
|
|
-// message: message
|
|
|
|
-// }
|
|
|
|
-// connectionRequest.server.messageToBePublishedFromApplication.next(payload)
|
|
|
|
-// connectionRequest2.server.messageToBePublishedFromApplication.next(payload)
|
|
|
|
-// }
|
|
|
|
-// })
|
|
|
|
|
|
+
|
|
|
|
+stream().subscribe({
|
|
|
|
+ next: message => {
|
|
|
|
+ let payload = {
|
|
|
|
+ id: hostServer,
|
|
|
|
+ message: message
|
|
|
|
+ }
|
|
|
|
+ connectionRequest1.server!.messageToBePublishedFromApplication.next(payload)
|
|
|
|
+ connectionRequest2.server!.messageToBePublishedFromApplication.next(payload)
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
|
|
// connectionRequest.client.messageToBeReceivedFromRemote.subscribe({
|
|
// connectionRequest.client.messageToBeReceivedFromRemote.subscribe({
|
|
// next: request => {
|
|
// next: request => {
|
|
@@ -328,7 +329,7 @@ function stream(): Subject<any> {
|
|
const intervalId = setInterval(() => {
|
|
const intervalId = setInterval(() => {
|
|
result.next(messages[count]);
|
|
result.next(messages[count]);
|
|
count++;
|
|
count++;
|
|
- if (count >= 1000) {
|
|
|
|
|
|
+ if (count >= 300) {
|
|
clearInterval(intervalId);
|
|
clearInterval(intervalId);
|
|
result.complete();
|
|
result.complete();
|
|
}
|
|
}
|