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

Method done

packages/ui/native/src/NativeHttpClient.ts:369–377  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367 return Effect.callback((resume) => {
368 const exchange = this.exchange
369 const done = () => {
370 const error = this.unreadable()
371 if (error) return resume(Effect.fail(error))
372 if (exchange.error === undefined) return
373 // Cache the joined body for repeat reads.
374 const body = exchange.chunks.splice(0).join("")
375 exchange.chunks.push(body)
376 resume(Effect.succeed(body))
377 }
378 exchange.listeners.add(done)
379 done()
380 return Effect.sync(() => exchange.listeners.delete(done))

Callers

nothing calls this directly

Calls 6

unreadableMethod · 0.95
failMethod · 0.65
pushMethod · 0.65
resumeFunction · 0.50
joinMethod · 0.45
succeedMethod · 0.45

Tested by

no test coverage detected