Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
add Scope for every http request (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored Dec 17, 2023
1 parent 3351136 commit 1d6bf73
Show file tree
Hide file tree
Showing 16 changed files with 221 additions and 132 deletions.
7 changes: 7 additions & 0 deletions .changeset/many-games-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@effect/platform-node": patch
"@effect/platform-bun": patch
"@effect/platform": patch
---

add Scope to every http request
4 changes: 2 additions & 2 deletions docs/platform-node/Http/Server.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ export declare const makeHandler: {
<R, E>(
httpApp: App.Default<R, E>
): Effect.Effect<
Exclude<R, ServerRequest.ServerRequest>,
Exclude<R, Scope.Scope | ServerRequest.ServerRequest>,
never,
(nodeRequest: Http.IncomingMessage, nodeResponse: Http.ServerResponse<Http.IncomingMessage>) => void
>
<R, E, App extends App.Default<any, any>>(
httpApp: App.Default<R, E>,
middleware: Middleware.Middleware.Applied<R, E, App>
): Effect.Effect<
Exclude<Effect.Effect.Context<App>, ServerRequest.ServerRequest>,
Exclude<Effect.Effect.Context<App>, Scope.Scope | ServerRequest.ServerRequest>,
never,
(nodeRequest: Http.IncomingMessage, nodeResponse: Http.ServerResponse<Http.IncomingMessage>) => void
>
Expand Down
6 changes: 3 additions & 3 deletions docs/platform/Http/App.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Added in v1.0.0
**Signature**
```ts
export declare const toWebHandler: <E>(self: Default<never, E>) => (request: Request) => Promise<Response>
export declare const toWebHandler: <E>(self: Default<Scope.Scope, E>) => (request: Request) => Promise<Response>
```
Added in v1.0.0
Expand All @@ -60,7 +60,7 @@ Added in v1.0.0
```ts
export declare const toWebHandlerLayer: <R, E, RE>(
self: Default<R, E>,
self: Default<Scope.Scope | R, E>,
layer: Layer.Layer<never, RE, R>
) => { readonly close: () => Promise<void>; readonly handler: (request: Request) => Promise<Response> }
```
Expand All @@ -74,7 +74,7 @@ Added in v1.0.0
```ts
export declare const toWebHandlerRuntime: <R>(
runtime: Runtime.Runtime<R>
) => <E>(self: Default<R, E>) => (request: Request) => Promise<Response>
) => <E>(self: Default<Scope.Scope | R, E>) => (request: Request) => Promise<Response>
```
Added in v1.0.0
Expand Down
Loading

0 comments on commit 1d6bf73

Please sign in to comment.