Moving IEmitter
This commit is contained in:
parent
8ba7fd628c
commit
79ff27cec2
@ -16,6 +16,7 @@ import {
|
||||
IAvailableServicesMsg,
|
||||
IAvailableTopicsMsg,
|
||||
ICommunicationInterface,
|
||||
IEmitter,
|
||||
IExternalEventMsg,
|
||||
IRequestTaskMsg,
|
||||
IResponseTaskMsg,
|
||||
@ -24,14 +25,6 @@ import {
|
||||
import { IDispatcherInfo } from "../types/nope/nopeDispatcher.interface";
|
||||
import { INopeObservable } from "../types/nope/nopeObservable.interface";
|
||||
|
||||
export interface IEmitter {
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
getMaxListeners?: () => number;
|
||||
setMaxListeners?: (n: number) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Communication Layer for the Dispatchers.
|
||||
* Here, only a Events are used.
|
||||
@ -43,7 +36,7 @@ export interface IEmitter {
|
||||
export class EventLayer implements ICommunicationInterface {
|
||||
connected: INopeObservable<boolean>;
|
||||
considerConnection = true;
|
||||
allowServiceRedundancy = false
|
||||
allowServiceRedundancy = false;
|
||||
|
||||
/**
|
||||
* Creaetes an Event Emitter-based Communication Layer:
|
||||
@ -204,7 +197,7 @@ export class EventLayer implements ICommunicationInterface {
|
||||
this._emitter.off("event_" + event, cb);
|
||||
}
|
||||
|
||||
async dispose(){
|
||||
async dispose(): Promise<void> {
|
||||
this.connected.dispose();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user