Class AbstractExchange<REQ, RES>
Constructors
constructor
- new AbstractExchange<REQ, RES>(reqCls: ClassType<REQ>, resCls: ClassType<RES>): AbstractExchange<REQ, RES>
-
Type parameters
Parameters
-
reqCls: ClassType<REQ>
-
resCls: ClassType<RES>
Properties
Private reqCache
reqCache: {} = {}
Readonly reqCls
reqCls: ClassType<REQ>
Readonly resCls
resCls: ClassType<RES>
Methods
create
-
Parameters
Returns Message<REQ, RES>
getReqClass
- getReqClass(): ClassType<REQ>
getResClass
- getResClass(): ClassType<RES>
getResponse
- getResponse(request: REQ): Promise<RES>
-
Parameters
Returns Promise<RES>
Abstract handleRequest
- handleRequest(request: REQ, response: RES): void
-
Parameters
-
request: REQ
-
response: RES
Returns void
Abstract handleResponse
- handleResponse(responses: RES, err: Error): any
-
Parameters
-
responses: RES
-
err: Error
Returns any
onRequest
- onRequest(request: REQ): Promise<any>
-
Parameters
Returns Promise<any>
prepare
- prepare(opts?: any): void
Give possiblity to mark this exchange as disabled