|
@@ -2,27 +2,23 @@
|
|
|
mechanism is still using message. Here as you will see, it is basically taking the already instantiated transmitter and receiver components
|
|
|
and basically just filtering the responses based on whatever identifier it needs for the orignal request. */
|
|
|
import { MessageTransmissionBase } from "../base/msg.transmission.base";
|
|
|
-import { filter, Observable, Observer, Subscription, Unsubscribable } from "rxjs";
|
|
|
-import { FisMessage, MessageReceiverInterface, MessageRequestResponseInterface, MessageTransmitterInterface, TransmissionConfig, TransmissionProfile } from "../interface/interface";
|
|
|
+import { filter, Observable, Observer, Subject, Subscription, Unsubscribable } from "rxjs";
|
|
|
+import { FisMessage, GeneralEvent, MessageReceiverInterface, MessageRequestResponseInterface, MessageTransmitterInterface, TransmissionConfig, TransmissionProfile } from "../interface/interface";
|
|
|
import ConsoleLogger from "../utils/log.utils";
|
|
|
import { checkRxType } from "../utils/general.utils";
|
|
|
|
|
|
-export class MessageTransmissionRequestResponse<T> implements MessageRequestResponseInterface<T> {
|
|
|
+export class MessageTransmissionRequestResponse<T> extends MessageTransmissionBase<T> {
|
|
|
private console: ConsoleLogger = new ConsoleLogger(`MessageTransmissionRequestResponse`, ['transmission'])
|
|
|
- private transmissionProfile!: TransmissionProfile
|
|
|
protected transmitterInstance!: MessageTransmitterInterface<any>;
|
|
|
protected receiverInstance!: MessageReceiverInterface<any>;
|
|
|
|
|
|
- constructor(config: TransmissionConfig, transmitterInstance: MessageTransmitterInterface<any>, receiverInstance: MessageReceiverInterface<any>) {
|
|
|
+ constructor(config: TransmissionConfig, event: Subject<GeneralEvent<any>>, transmitterInstance: MessageTransmitterInterface<any>, receiverInstance: MessageReceiverInterface<any>) {
|
|
|
+ super(config, event)
|
|
|
this.console.log({ message: `Constructing Request Response Transmission for Receiving target: ${config.target}` })
|
|
|
this.transmitterInstance = transmitterInstance
|
|
|
this.receiverInstance = receiverInstance
|
|
|
}
|
|
|
|
|
|
- getTransmissionProfile(type?: `config` | `id` | `role`): TransmissionProfile | TransmissionConfig | string | undefined {
|
|
|
- return type ? this.transmissionProfile[type] : this.transmissionProfile;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
subscribe(observer: Observer<T> | Observable<T>): Unsubscribable | null {
|
|
|
if (checkRxType(observer) === `Observable`) {
|