@@ -219,7 +219,8 @@ export interface Handlers<
219
219
*/
220
220
handle < Name extends HttpApiEndpoint . HttpApiEndpoint . Name < Endpoints > , R1 > (
221
221
name : Name ,
222
- handler : HttpApiEndpoint . HttpApiEndpoint . HandlerWithName < Endpoints , Name , E , R1 >
222
+ handler : HttpApiEndpoint . HttpApiEndpoint . HandlerWithName < Endpoints , Name , E , R1 > ,
223
+ options ?: { readonly uninterruptible ?: boolean | undefined } | undefined
223
224
) : Handlers <
224
225
E ,
225
226
Provides ,
@@ -241,7 +242,8 @@ export interface Handlers<
241
242
*/
242
243
handleRaw < Name extends HttpApiEndpoint . HttpApiEndpoint . Name < Endpoints > , R1 > (
243
244
name : Name ,
244
- handler : HttpApiEndpoint . HttpApiEndpoint . HandlerResponseWithName < Endpoints , Name , E , R1 >
245
+ handler : HttpApiEndpoint . HttpApiEndpoint . HandlerResponseWithName < Endpoints , Name , E , R1 > ,
246
+ options ?: { readonly uninterruptible ?: boolean | undefined } | undefined
245
247
) : Handlers <
246
248
E ,
247
249
Provides ,
@@ -285,6 +287,7 @@ export declare namespace Handlers {
285
287
readonly endpoint : HttpApiEndpoint . HttpApiEndpoint . Any
286
288
readonly handler : HttpApiEndpoint . HttpApiEndpoint . Handler < any , E , R >
287
289
readonly withFullResponse : boolean
290
+ readonly uninterruptible : boolean
288
291
}
289
292
290
293
/**
@@ -378,30 +381,34 @@ const HandlersProto = {
378
381
handle (
379
382
this : Handlers < any , any , any , HttpApiEndpoint . HttpApiEndpoint . Any > ,
380
383
name : string ,
381
- handler : HttpApiEndpoint . HttpApiEndpoint . Handler < any , any , any >
384
+ handler : HttpApiEndpoint . HttpApiEndpoint . Handler < any , any , any > ,
385
+ options ?: { readonly uninterruptible ?: boolean | undefined } | undefined
382
386
) {
383
387
const endpoint = this . group . endpoints [ name ]
384
388
return makeHandlers ( {
385
389
group : this . group ,
386
390
handlers : Chunk . append ( this . handlers , {
387
391
endpoint,
388
392
handler,
389
- withFullResponse : false
393
+ withFullResponse : false ,
394
+ uninterruptible : options ?. uninterruptible ?? false
390
395
} ) as any
391
396
} )
392
397
} ,
393
398
handleRaw (
394
399
this : Handlers < any , any , any , HttpApiEndpoint . HttpApiEndpoint . Any > ,
395
400
name : string ,
396
- handler : HttpApiEndpoint . HttpApiEndpoint . Handler < any , any , any >
401
+ handler : HttpApiEndpoint . HttpApiEndpoint . Handler < any , any , any > ,
402
+ options ?: { readonly uninterruptible ?: boolean | undefined } | undefined
397
403
) {
398
404
const endpoint = this . group . endpoints [ name ]
399
405
return makeHandlers ( {
400
406
group : this . group ,
401
407
handlers : Chunk . append ( this . handlers , {
402
408
endpoint,
403
409
handler,
404
- withFullResponse : true
410
+ withFullResponse : true ,
411
+ uninterruptible : options ?. uninterruptible ?? false
405
412
} ) as any
406
413
} )
407
414
}
@@ -473,7 +480,8 @@ export const group = <
473
480
( input ) => Context . merge ( context , input )
474
481
)
475
482
} ,
476
- item . withFullResponse
483
+ item . withFullResponse ,
484
+ item . uninterruptible
477
485
) )
478
486
}
479
487
yield * router . concat ( HttpRouter . fromIterable ( routes ) )
@@ -615,7 +623,8 @@ const handlerToRoute = (
615
623
endpoint_ : HttpApiEndpoint . HttpApiEndpoint . Any ,
616
624
middleware : MiddlewareMap ,
617
625
handler : HttpApiEndpoint . HttpApiEndpoint . Handler < any , any , any > ,
618
- isFullResponse : boolean
626
+ isFullResponse : boolean ,
627
+ uninterruptible : boolean
619
628
) : HttpRouter . Route < any , any > => {
620
629
const endpoint = endpoint_ as HttpApiEndpoint . HttpApiEndpoint . AnyWithProps
621
630
const decodePath = Option . map ( endpoint . pathSchema , Schema . decodeUnknown )
@@ -657,7 +666,8 @@ const handlerToRoute = (
657
666
} ) . pipe (
658
667
Effect . catchIf ( ParseResult . isParseError , HttpApiDecodeError . refailParseError )
659
668
)
660
- )
669
+ ) ,
670
+ { uninterruptible }
661
671
)
662
672
}
663
673
0 commit comments