Add Effect v4 support, Fast Refresh tooling, and revamped docs #56
@@ -12,7 +12,6 @@ export interface ScopeRegistryService {
|
|||||||
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>
|
||||||
readonly dispose: Effect.Effect<void>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export declare namespace ScopeRegistryService {
|
export declare namespace ScopeRegistryService {
|
||||||
@@ -94,6 +93,7 @@ export class ScopeRegistryServiceImpl implements ScopeRegistryService {
|
|||||||
)),
|
)),
|
||||||
})),
|
})),
|
||||||
Stream.runDrain,
|
Stream.runDrain,
|
||||||
|
Effect.ensuring(this.dispose),
|
||||||
this.runSemaphore.withPermit,
|
this.runSemaphore.withPermit,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -173,8 +173,5 @@ export class ScopeRegistry extends Context.Service<ScopeRegistry, ScopeRegistryS
|
|||||||
|
|
||||||
export const layer = Layer.effect(ScopeRegistry, Effect.tap(
|
export const layer = Layer.effect(ScopeRegistry, Effect.tap(
|
||||||
make,
|
make,
|
||||||
registry => Effect.andThen(
|
registry => Effect.forkScoped(registry.run),
|
||||||
Effect.addFinalizer(() => registry.dispose),
|
|
||||||
Effect.forkScoped(registry.run),
|
|
||||||
),
|
|
||||||
))
|
))
|
||||||
|
|||||||
Reference in New Issue
Block a user