MCPcopy Create free account
hub / github.com/Effect-TS/effect / pendingInline

Function pendingInline

packages/effect/test/FileSystem.test.ts:82–97  ·  view source on GitHub ↗
(d00: Effect.Effect<never, PlatformError.PlatformError>)

Source from the content-addressed store, hash-verified

80// Holds the forked reads `d00` to `d15` until `d63` is being read inline. A
81// serial walk never reaches `d63`, so `d00` stops waiting after 200 millis.
82const pendingInline = (d00: Effect.Effect<never, PlatformError.PlatformError>) => {
83 const inline = Latch.makeUnsafe()
84 return makeFileSystem({
85 directories: wideTree,
86 readDirectory: (path) => {
87 const index = wide.indexOf(path)
88 return index === 63
89 ? Effect.andThen(Latch.open(inline), Effect.never)
90 : index === 0
91 ? Effect.andThen(Effect.timeoutOption(Latch.await(inline), "200 millis"), d00)
92 : index > 0 && index < 16
93 ? Effect.andThen(Latch.await(inline), Effect.succeed(["x.ts"]))
94 : undefined
95 }
96 })
97}
98
99describe("FileSystem", () => {
100 describe("derived glob", () => {

Callers 1

FileSystem.test.tsFile · 0.85

Calls 4

makeFileSystemFunction · 0.85
awaitMethod · 0.65
openMethod · 0.45
succeedMethod · 0.45

Tested by

no test coverage detected