MCPcopy
hub / github.com/Tencent/TSW / EventBus

Interface EventBus

lib/core/bus.ts:56–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56interface EventBus extends EventEmitter {
57 emit(
58 event: EVENT_LIST.DNS_LOOKUP_SUCCESS,
59 payload: string | dns.LookupAddress[]
60 ): boolean;
61 emit(
62 event: EVENT_LIST.DNS_LOOKUP_ERROR,
63 payload: NodeJS.ErrnoException
64 ): boolean;
65 emit(
66 event: EVENT_LIST.RESPONSE_START,
67 payload: ResponseEventPayload
68 ): boolean;
69 emit(
70 event: EVENT_LIST.RESPONSE_FINISH,
71 payload: ResponseEventPayload
72 ): boolean;
73 emit(
74 event: EVENT_LIST.RESPONSE_CLOSE,
75 payload: ResponseEventPayload
76 ): boolean;
77 emit(
78 event: EVENT_LIST.REQUEST_START,
79 payload: RequestEventPayload
80 ): boolean;
81
82 on(
83 event: EVENT_LIST.DNS_LOOKUP_SUCCESS,
84 listener: (payload: string | dns.LookupAddress[]) => void
85 ): this;
86 on(
87 event: EVENT_LIST.DNS_LOOKUP_ERROR,
88 listener: (payload: NodeJS.ErrnoException) => void
89 ): this;
90 on(
91 event: EVENT_LIST.RESPONSE_START,
92 listener: (payload: ResponseEventPayload) => void
93 ): this;
94 on(
95 event: EVENT_LIST.RESPONSE_FINISH,
96 listener: (payload: ResponseEventPayload) => void
97 ): this;
98 on(
99 event: EVENT_LIST.RESPONSE_CLOSE,
100 listener: (payload: ResponseEventPayload) => void
101 ): this;
102 on(
103 event: EVENT_LIST.REQUEST_START,
104 listener: (payload: RequestEventPayload) => void
105 ): this;
106
107 once(
108 event: EVENT_LIST.DNS_LOOKUP_SUCCESS,
109 listener: (payload: string | dns.LookupAddress[]) => void
110 ): this;
111 once(
112 event: EVENT_LIST.DNS_LOOKUP_ERROR,
113 listener: (payload: NodeJS.ErrnoException) => void

Callers 11

requestListenerWrapFunction · 0.80
callbackWrapFunction · 0.80
requestListenerWrapFunction · 0.80
index.test.tsFile · 0.80
incoming.test.tsFile · 0.80
dns.hack.test.tsFile · 0.80
index.test.tsFile · 0.80
requestListenerWrapFunction · 0.80
hackFunction · 0.80
incoming.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected