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

Commit

Permalink
fix interruption
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Dec 17, 2023
1 parent e642170 commit bf2db72
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/platform-browser/src/internal/workerRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as Runtime from "@effect/platform/Runtime"
import { WorkerError } from "@effect/platform/WorkerError"
import * as Runner from "@effect/platform/WorkerRunner"
import type * as Schema from "@effect/schema/Schema"
import { Cause } from "effect"
import * as Cause from "effect/Cause"
import * as Effect from "effect/Effect"
import * as Layer from "effect/Layer"
import * as Queue from "effect/Queue"
Expand Down
22 changes: 8 additions & 14 deletions packages/platform-node/src/internal/http/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type * as Path from "@effect/platform/Path"
import * as Cause from "effect/Cause"
import * as Config from "effect/Config"
import * as Effect from "effect/Effect"
import type { LazyArg } from "effect/Function"
import { type LazyArg } from "effect/Function"
import * as Layer from "effect/Layer"
import * as Option from "effect/Option"
import * as Runtime from "effect/Runtime"
Expand Down Expand Up @@ -70,19 +70,13 @@ export const make = (
hostname: address.address,
port: address.port
},
serve: (httpApp, middleware) =>
Effect.asUnit(
Effect.acquireRelease(
Effect.tap(makeHandler(httpApp, middleware!), (handler) =>
Effect.sync(() => {
server.on("request", handler)
})),
(handler) =>
Effect.sync(() => {
server.off("request", handler)
})
)
)
serve: (httpApp, middleware) => Effect.gen(function* (_) {

Check failure on line 73 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Require line break(s)

Check failure on line 73 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Extra whitespace(s)
const handler = yield* _(makeHandler(httpApp, middleware!))

Check failure on line 74 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Require tweaking whitespace(s)
yield* _(Effect.addFinalizer(() => Effect.sync(() => {

Check failure on line 75 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Require tweaking whitespace(s)

Check failure on line 75 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Require line break(s)
server.off("request", handler)

Check failure on line 76 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Require tweaking whitespace(s)
})))

Check failure on line 77 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Require tweaking whitespace(s)

Check failure on line 77 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Require line break(s)
server.on("request", handler)

Check failure on line 78 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Require tweaking whitespace(s)
})

Check failure on line 79 in packages/platform-node/src/internal/http/server.ts

View workflow job for this annotation

GitHub Actions / Lint

Require tweaking whitespace(s)
})
}).pipe(
Effect.locally(
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-node/src/internal/stream.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SizeInput } from "@effect/platform/FileSystem"
import type { Cause } from "effect"
import type * as Cause from "effect/Cause"
import * as Channel from "effect/Channel"
import * as Chunk from "effect/Chunk"
import * as Effect from "effect/Effect"
Expand Down
2 changes: 1 addition & 1 deletion packages/platform/src/Http/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*/
import type * as ParseResult from "@effect/schema/ParseResult"
import type * as Schema from "@effect/schema/Schema"
import type { Scope } from "effect"
import type * as Cause from "effect/Cause"
import type * as Chunk from "effect/Chunk"
import type * as Context from "effect/Context"
import type * as Effect from "effect/Effect"
import type * as Option from "effect/Option"
import type * as Scope from "effect/Scope"
import * as internal from "../internal/http/router.js"
import type * as App from "./App.js"
import type * as Method from "./Method.js"
Expand Down

0 comments on commit bf2db72

Please sign in to comment.