title: Can't cancel request in interceptor
body: <p>I'm trying to cancel request processing for requests longer than n seconds. For example, in this sample <a href="https://github.com/nestjs/nest/tree/master/sample/01-cats-app" rel="nofollow noreferrer">https://github.com/nestjs/nest/tree/master/sample/01-cats-app</a></p>
  
  <p>In <code>cats.controller.ts</code> replace</p>
  
  <pre class="lang-js prettyprint-override"><code>@UseInterceptors(LoggingInterceptor, TransformInterceptor)
  </code></pre>
  
  <p>with</p>
  
  <pre class="lang-js prettyprint-override"><code>@UseInterceptors(TimeoutInterceptor, LoggingInterceptor, TransformInterceptor)
  </code></pre>
  
  <p>In <code>cats.controller.ts</code> replace</p>
  
  <pre class="lang-js prettyprint-override"><code>  @Get()
    async findAll(): Promise&lt;Cat[]&gt; {
      return this.catsService.findAll();
    }
  </code></pre>
  
  <p>with</p>
  
  <pre class="lang-js prettyprint-override"><code>  @Get()
    async findAll(): Promise&lt;Cat[]&gt; {
      for (let i = 0; i &lt; 100000000; i++) {
        if (i === 99999999) {
          return this.catsService.findAll();
        }
      }
    }
  </code></pre>
  
  <p>Add interceptor source:</p>
  
  <pre class="lang-js prettyprint-override"><code>import {
    CallHandler,
    ExecutionContext,
    Injectable,
    NestInterceptor,
  } from '@nestjs/common';
  import { Observable } from 'rxjs';
  import { timeout } from 'rxjs/operators';
  
  @Injectable()
  export class TimeoutInterceptor implements NestInterceptor {
    intercept(context: ExecutionContext, next: CallHandler): Observable&lt;any&gt; {
      return next.handle().pipe(timeout(1));
    }
  }
  </code></pre>
  
  <p>Request processing even after 1 ms and returns data. Logs:</p>
  
  <pre><code>Before...
  After... 134ms
  </code></pre>
  
  <p>Interceptor's code from here: <a href="https://docs.nestjs.com/interceptors" rel="nofollow noreferrer">https://docs.nestjs.com/interceptors</a></p>
  
  <p>What I did wrong?</p>