Add Effect v4 support, Fast Refresh tooling, and revamped docs #56

Merged
Thilawyn merged 133 commits from next into master 2026-07-26 02:32:59 +02:00
Showing only changes of commit d8b9c0394c - Show all commits
+5 -4
View File
@@ -11,7 +11,7 @@ export interface ScopeRegistryService {
commit(key: ScopeRegistryService.Key): Effect.Effect<ScopeRegistryService.Entry, Cause.NoSuchElementError> commit(key: ScopeRegistryService.Key): Effect.Effect<ScopeRegistryService.Entry, Cause.NoSuchElementError>
release(key: ScopeRegistryService.Key): Effect.Effect<ScopeRegistryService.Entry, Cause.NoSuchElementError> release(key: ScopeRegistryService.Key): Effect.Effect<ScopeRegistryService.Entry, Cause.NoSuchElementError>
readonly run: Effect.Effect<void> readonly run: Effect.Effect<void, never, Scope.Scope>
} }
export declare namespace ScopeRegistryService { export declare namespace ScopeRegistryService {
@@ -81,8 +81,9 @@ export class ScopeRegistryServiceImpl implements ScopeRegistryService {
) )
} }
get run(): Effect.Effect<void> { get run(): Effect.Effect<void, never, Scope.Scope> {
return SubscriptionRef.changes(this.ref).pipe( return Effect.addFinalizer(() => this.dispose).pipe(
Effect.andThen(SubscriptionRef.changes(this.ref).pipe(
Stream.switchMap(entries => Option.match(this.getNextExpiration(entries), { Stream.switchMap(entries => Option.match(this.getNextExpiration(entries), {
onNone: () => Stream.never, onNone: () => Stream.never,
onSome: expiresAt => Stream.fromEffect(DateTime.now.pipe( onSome: expiresAt => Stream.fromEffect(DateTime.now.pipe(
@@ -93,7 +94,7 @@ export class ScopeRegistryServiceImpl implements ScopeRegistryService {
)), )),
})), })),
Stream.runDrain, Stream.runDrain,
Effect.ensuring(this.dispose), )),
this.runSemaphore.withPermit, this.runSemaphore.withPermit,
) )
} }