···319319// HOW IT WORKS:
320320// 1. async() takes a "register" function
321321// 2. The register function receives a "resume" callback
322322-// 3. You start your async work and call resume(Exit.succeed(value)) or resume(Exit.fail(error))
322322+// 3. You start your async work and call resume(Exit.success(value)) or resume(Exit.failure(error))
323323// 4. Return a cleanup function - it runs on cancellation
324324//
325325// GOTCHA: The AbortController abort() must happen in the cleanup function.
···337337 .then((response) =>
338338 !response.ok
339339 ? response.status === 404
340340- ? resume(Exit.fail(HttpError.notFound(url)))
341341- : resume(Exit.fail(HttpError.serverError(response.status)))
340340+ ? resume(Exit.failure(HttpError.notFound(url)))
341341+ : resume(Exit.failure(HttpError.serverError(response.status)))
342342 : response.json().then((data: unknown) =>
343343 // Use type guard instead of casting - validates at runtime
344344 isUser(data)
345345- ? resume(Exit.succeed(data))
346346- : resume(Exit.fail(HttpError.serverError(500))),
345345+ ? resume(Exit.success(data))
346346+ : resume(Exit.failure(HttpError.serverError(500))),
347347 ),
348348 )
349349 .catch((err) => {
350350 // GOTCHA: Don't resume on AbortError - the fiber is already cancelled
351351 // Resuming after cancellation would cause undefined behavior
352352 if (err.name === "AbortError") return
353353- resume(Exit.fail(HttpError.network(err.message)))
353353+ resume(Exit.failure(HttpError.network(err.message)))
354354 })
355355356356 // THE KEY INSIGHT: This cleanup function runs automatically on timeout/interrupt
···9090// HOW IT WORKS:
9191// 1. async() takes a "register" function
9292// 2. The register function receives a "resume" callback
9393-// 3. You start your async work and call resume(Exit.succeed(value)) or resume(Exit.fail(error))
9393+// 3. You start your async work and call resume(Exit.success(value)) or resume(Exit.failure(error))
9494// 4. Return a cleanup function - it runs on cancellation
9595//
9696// GOTCHA: The AbortController abort() must happen in the cleanup function.
···108108 .then((response) =>
109109 !response.ok
110110 ? response.status === 404
111111- ? resume(Exit.fail(HttpError.notFound(url)))
112112- : resume(Exit.fail(HttpError.serverError(response.status)))
111111+ ? resume(Exit.failure(HttpError.notFound(url)))
112112+ : resume(Exit.failure(HttpError.serverError(response.status)))
113113 : response.json().then((data: unknown) =>
114114 // Use type guard instead of casting - validates at runtime
115115 isUser(data)
116116- ? resume(Exit.succeed(data))
117117- : resume(Exit.fail(HttpError.serverError(500))),
116116+ ? resume(Exit.success(data))
117117+ : resume(Exit.failure(HttpError.serverError(500))),
118118 ),
119119 )
120120 .catch((err) => {
121121 // GOTCHA: Don't resume on AbortError - the fiber is already cancelled
122122 // Resuming after cancellation would cause undefined behavior
123123 if (err.name === "AbortError") return
124124- resume(Exit.fail(HttpError.network(err.message)))
124124+ resume(Exit.failure(HttpError.network(err.message)))
125125 })
126126127127 // THE KEY INSIGHT: This cleanup function runs automatically on timeout/interrupt