@@ -59,8 +59,7 @@ extends Pipeable.Class() implements Query<K, A, E, R, P> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get run(): Effect.Effect<void> {
|
get run(): Effect.Effect<void> {
|
||||||
return Effect.provide(
|
return Stream.runForEach(this.key, key => this.interrupt.pipe(
|
||||||
Stream.runForEach(this.key, key => this.interrupt.pipe(
|
|
||||||
Effect.andThen(SubscriptionRef.set(this.latestKey, Option.some(key))),
|
Effect.andThen(SubscriptionRef.set(this.latestKey, Option.some(key))),
|
||||||
Effect.andThen(this.latestFinalResult),
|
Effect.andThen(this.latestFinalResult),
|
||||||
Effect.andThen(previous => this.startCached(key, Option.isSome(previous)
|
Effect.andThen(previous => this.startCached(key, Option.isSome(previous)
|
||||||
@@ -68,9 +67,9 @@ extends Pipeable.Class() implements Query<K, A, E, R, P> {
|
|||||||
: Result.initial()
|
: Result.initial()
|
||||||
)),
|
)),
|
||||||
Effect.andThen(sub => Effect.forkScoped(this.watch(key, sub))),
|
Effect.andThen(sub => Effect.forkScoped(this.watch(key, sub))),
|
||||||
|
)).pipe(
|
||||||
this.runSemaphore.withPermits(1),
|
this.runSemaphore.withPermits(1),
|
||||||
)),
|
Effect.provide(this.context),
|
||||||
this.context,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user