MCPcopy
hub / github.com/nestjs/nest / emitBatch

Method emitBatch

packages/microservices/client/client-kafka.ts:262–278  ·  view source on GitHub ↗
(
    pattern: any,
    data: { messages: TInput[] },
  )

Source from the content-addressed store, hash-verified

260 }
261
262 public emitBatch<TResult = any, TInput = any>(
263 pattern: any,
264 data: { messages: TInput[] },
265 ): Observable<TResult> {
266 if (isNil(pattern) || isNil(data)) {
267 return _throw(() => new InvalidMessageException());
268 }
269 const source = defer(async () => this.connect()).pipe(
270 mergeMap(() => this.dispatchBatchEvent({ pattern, data })),
271 );
272 const connectableSource = connectable(source, {
273 connector: () => new Subject(),
274 resetOnDisconnect: false,
275 });
276 connectableSource.connect();
277 return connectableSource;
278 }
279
280 public commitOffsets(
281 topicPartitions: TopicPartitionOffsetAndMetadata[],

Callers 1

Calls 4

connectMethod · 0.95
dispatchBatchEventMethod · 0.95
isNilFunction · 0.90
pipeMethod · 0.45

Tested by

no test coverage detected