iAccount based inUnited States
About this account
- Account based in
- United States
- Connected via
- United States App Store
Account-level information from X, not a live location or the device used for a specific post.
Type-checking the cloud @alchemy_run
- Tweets8.5K
- Following1.3K
- Followers5.6K
- Likes12K
This video is larger than Cloudflare's 512 MB cache, so it can't be played through. More donations are needed to cover a larger cache. Donate
ALT honk@gosling effect-basic % bat demo.js import './polyfill.js' import { Context, Data, Effect, Layer, Schedule } from 'effect' class Flaky extends Data.TaggedError('Flaky') {} class Api extends Context.Service()('Api') {} const ApiLive = Layer.effect(Api, Effect.gen(function* () { let calls = 0 yield* Effect.acquireRelease(Effect.log('connect'), () => Effect.log('disconnect')) return { get: id => Effect.suspend(() => ++calls < 3 ? Effect.fail(new Flaky()) : Effect.succeed({ id, calls })) } })) const main = Effect.gen(function* () { const api = yield* Api const user = yield* api.get(42).pipe( Effect.tapError(e => Effect.log(`retrying after ${e._tag}`)), Effect.retry(Schedule.recurs(5)) ) yield* Effect.log(`user ${user.id} after ${user.calls} calls`) }) Effect.runSync(main.pipe(Effect.provide(ApiLive))) honk@gosling effect-basic % ~/porffor/porf demo.js [20:38:07.977] INFO (#1): connect [20:38:07.977] INFO (#1): retrying after Flaky (alt text too long sorry)