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

Method sseBurst

integration/nest-application/sse/src/app.controller.ts:45–58  ·  view source on GitHub ↗
(
    @Query('n') n = '20',
    @Query('size') size = '65536',
  )

Source from the content-addressed store, hash-verified

43
44 @Sse('sse/burst')
45 sseBurst(
46 @Query('n') n = '20',
47 @Query('size') size = '65536',
48 ): Observable<MessageEvent> {
49 const count = parseInt(n, 10);
50 const payload = 'X'.repeat(parseInt(size, 10));
51
52 return new Observable(subscriber => {
53 for (let i = 0; i < count; i++) {
54 subscriber.next({ data: payload });
55 }
56 subscriber.complete();
57 });
58 }
59
60 @Sse('sse/post', { method: RequestMethod.POST })
61 ssePost(@Body() body: { content?: string }): Observable<MessageEvent> {

Callers

nothing calls this directly

Calls 3

QueryFunction · 0.90
nextMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected