mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
ad monitoring
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as signalR from '@microsoft/signalr';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { BehaviorSubject, Observable, race, timer } from 'rxjs';
|
||||
import { ok, Result, err } from 'neverthrow';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { filter, first } from 'rxjs/operators';
|
||||
@@ -232,6 +232,28 @@ export class SignalRConnection {
|
||||
resolve(ok(value));
|
||||
});
|
||||
|
||||
// // Create an observable for the timeout (8 seconds)
|
||||
// const timeout$ = timer(8000);
|
||||
|
||||
// // Create an observable for the message
|
||||
// const message$ = this.messageUPdateSubject.pipe(
|
||||
// filter((message: MessageOutPutDataDTO) => requestId === message?.requestId),
|
||||
// first()
|
||||
// );
|
||||
|
||||
// // Use race to choose whichever completes first (either the message or the timeout)
|
||||
// race(message$, timeout$).subscribe({
|
||||
// next: (value) => {
|
||||
// if (typeof value === 'number') {
|
||||
// // If the value is a number, it means the timeout fired
|
||||
// reject(err('No response, timeout'));
|
||||
// } else {
|
||||
// resolve(ok(value));
|
||||
// }
|
||||
// },
|
||||
// error: (error) => reject(err('Error: ' + error))
|
||||
// });
|
||||
|
||||
} else {
|
||||
this.sendLaterSubject.next({method: 'SendMessage', args: data})
|
||||
return reject(err(false))
|
||||
|
||||
Reference in New Issue
Block a user