@effect/stream
Advanced tools
Comparing version 0.34.0 to 0.35.0
@@ -6,4 +6,4 @@ "use strict"; | ||
}); | ||
exports.write = exports.updateService = exports.unwrapScoped = exports.unwrap = exports.unit = exports.toStream = exports.toSink = exports.toQueue = exports.toPull = exports.toHub = exports.sync = exports.succeed = exports.scoped = exports.runDrain = exports.runCollect = exports.run = exports.repeated = exports.readWithCause = exports.readWith = exports.readOrFail = exports.read = exports.provideSomeLayer = exports.provideService = exports.provideLayer = exports.provideContext = exports.pipeToOrFail = exports.pipeTo = exports.orElse = exports.orDieWith = exports.orDie = exports.never = exports.mergeWith = exports.mergeOutWith = exports.mergeOut = exports.mergeMap = exports.mergeAllWith = exports.mergeAllUnboundedWith = exports.mergeAllUnbounded = exports.mergeAll = exports.mapOutEffectPar = exports.mapOutEffect = exports.mapOut = exports.mapErrorCause = exports.mapError = exports.mapEffect = exports.map = exports.isChannelException = exports.interruptWhenDeferred = exports.interruptWhen = exports.identity = exports.fromQueue = exports.fromOption = exports.fromInput = exports.fromHubScoped = exports.fromHub = exports.fromEither = exports.fromEffect = exports.foldChannel = exports.foldCauseChannel = exports.flatten = exports.flatMap = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.ensuringWith = exports.ensuring = exports.emitCollect = exports.embedInput = exports.drain = exports.doneCollect = exports.contramapInEffect = exports.contramapIn = exports.contramapErrorEffect = exports.contramapError = exports.contramapEffect = exports.contramapContext = exports.contramap = exports.contextWithEffect = exports.contextWithChannel = exports.contextWith = exports.context = exports.concatOut = exports.concatMapWithCustom = exports.concatMapWith = exports.concatMap = exports.concatAllWith = exports.concatAll = exports.collect = exports.catchAllCause = exports.catchAll = exports.bufferChunk = exports.buffer = exports.asUnit = exports.as = exports.acquireUseRelease = exports.acquireReleaseOut = exports.ChannelTypeId = exports.ChannelExceptionTypeId = exports.ChannelException = void 0; | ||
exports.zipRight = exports.zipLeft = exports.zip = exports.writeChunk = exports.writeAll = void 0; | ||
exports.withSpan = exports.updateService = exports.unwrapScoped = exports.unwrap = exports.unit = exports.toStream = exports.toSink = exports.toQueue = exports.toPull = exports.toHub = exports.sync = exports.succeed = exports.scoped = exports.runDrain = exports.runCollect = exports.run = exports.repeated = exports.readWithCause = exports.readWith = exports.readOrFail = exports.read = exports.provideSomeLayer = exports.provideService = exports.provideLayer = exports.provideContext = exports.pipeToOrFail = exports.pipeTo = exports.orElse = exports.orDieWith = exports.orDie = exports.never = exports.mergeWith = exports.mergeOutWith = exports.mergeOut = exports.mergeMap = exports.mergeAllWith = exports.mergeAllUnboundedWith = exports.mergeAllUnbounded = exports.mergeAll = exports.mapOutEffectPar = exports.mapOutEffect = exports.mapOut = exports.mapErrorCause = exports.mapError = exports.mapEffect = exports.map = exports.isChannelException = exports.interruptWhenDeferred = exports.interruptWhen = exports.identity = exports.fromQueue = exports.fromOption = exports.fromInput = exports.fromHubScoped = exports.fromHub = exports.fromEither = exports.fromEffect = exports.foldChannel = exports.foldCauseChannel = exports.flatten = exports.flatMap = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.ensuringWith = exports.ensuring = exports.emitCollect = exports.embedInput = exports.drain = exports.doneCollect = exports.contramapInEffect = exports.contramapIn = exports.contramapErrorEffect = exports.contramapError = exports.contramapEffect = exports.contramapContext = exports.contramap = exports.contextWithEffect = exports.contextWithChannel = exports.contextWith = exports.context = exports.concatOut = exports.concatMapWithCustom = exports.concatMapWith = exports.concatMap = exports.concatAllWith = exports.concatAll = exports.collect = exports.catchAllCause = exports.catchAll = exports.bufferChunk = exports.buffer = exports.asUnit = exports.as = exports.acquireUseRelease = exports.acquireReleaseOut = exports.ChannelTypeId = exports.ChannelExceptionTypeId = exports.ChannelException = void 0; | ||
exports.zipRight = exports.zipLeft = exports.zip = exports.writeChunk = exports.writeAll = exports.write = void 0; | ||
var channel = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/internal/channel")); | ||
@@ -863,2 +863,10 @@ var core = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/internal/core")); | ||
/** | ||
* Wraps the channel with a new span for tracing. | ||
* | ||
* @since 1.0.0 | ||
* @category tracing | ||
*/ | ||
exports.updateService = updateService; | ||
const withSpan = channel.withSpan; | ||
/** | ||
* Writes a single value to the channel. | ||
@@ -869,3 +877,3 @@ * | ||
*/ | ||
exports.updateService = updateService; | ||
exports.withSpan = withSpan; | ||
const write = core.write; | ||
@@ -872,0 +880,0 @@ /** |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.zipRight = exports.zipLeft = exports.zip = exports.writeChunk = exports.writeAll = exports.updateService = exports.unwrapScoped = exports.unwrap = exports.toQueue = exports.toPull = exports.toHub = exports.serviceWithEffect = exports.serviceWithChannel = exports.serviceWith = exports.service = exports.scoped = exports.runDrain = exports.runCollect = exports.run = exports.repeated = exports.read = exports.provideSomeLayer = exports.provideService = exports.provideLayer = exports.pipeToOrFail = exports.orElse = exports.orDieWith = exports.orDie = exports.never = exports.mergeWith = exports.mergeOutWith = exports.mergeOut = exports.mergeMap = exports.mergeAllWith = exports.mergeAllUnboundedWith = exports.mergeAllUnbounded = exports.mergeAll = exports.mapOutEffectPar = exports.mapOutEffect = exports.mapOut = exports.mapErrorCause = exports.mapError = exports.mapEffect = exports.map = exports.isChannelException = exports.interruptWhenDeferred = exports.interruptWhen = exports.identityChannel = exports.fromQueue = exports.fromOption = exports.fromInput = exports.fromHubScoped = exports.fromHub = exports.fromEither = exports.foldChannel = exports.flatten = exports.ensuring = exports.emitCollect = exports.drain = exports.doneCollect = exports.contramapInEffect = exports.contramapIn = exports.contramapErrorEffect = exports.contramapError = exports.contramapEffect = exports.contramapContext = exports.contramap = exports.contextWithEffect = exports.contextWithChannel = exports.contextWith = exports.context = exports.concatOut = exports.concatMap = exports.collect = exports.catchAll = exports.bufferChunk = exports.buffer = exports.asUnit = exports.as = exports.acquireUseRelease = exports.ChannelExceptionTypeId = exports.ChannelException = void 0; | ||
exports.zipRight = exports.zipLeft = exports.zip = exports.writeChunk = exports.writeAll = exports.withSpan = exports.updateService = exports.unwrapScoped = exports.unwrap = exports.toQueue = exports.toPull = exports.toHub = exports.serviceWithEffect = exports.serviceWithChannel = exports.serviceWith = exports.service = exports.scoped = exports.runDrain = exports.runCollect = exports.run = exports.repeated = exports.read = exports.provideSomeLayer = exports.provideService = exports.provideLayer = exports.pipeToOrFail = exports.orElse = exports.orDieWith = exports.orDie = exports.never = exports.mergeWith = exports.mergeOutWith = exports.mergeOut = exports.mergeMap = exports.mergeAllWith = exports.mergeAllUnboundedWith = exports.mergeAllUnbounded = exports.mergeAll = exports.mapOutEffectPar = exports.mapOutEffect = exports.mapOut = exports.mapErrorCause = exports.mapError = exports.mapEffect = exports.map = exports.isChannelException = exports.interruptWhenDeferred = exports.interruptWhen = exports.identityChannel = exports.fromQueue = exports.fromOption = exports.fromInput = exports.fromHubScoped = exports.fromHub = exports.fromEither = exports.foldChannel = exports.flatten = exports.ensuring = exports.emitCollect = exports.drain = exports.doneCollect = exports.contramapInEffect = exports.contramapIn = exports.contramapErrorEffect = exports.contramapError = exports.contramapEffect = exports.contramapContext = exports.contramap = exports.contextWithEffect = exports.contextWithChannel = exports.contextWith = exports.context = exports.concatOut = exports.concatMap = exports.collect = exports.catchAll = exports.bufferChunk = exports.buffer = exports.asUnit = exports.as = exports.acquireUseRelease = exports.ChannelExceptionTypeId = exports.ChannelException = void 0; | ||
var Chunk = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Chunk")); | ||
@@ -306,3 +306,3 @@ var Context = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Context")); | ||
const pull = yield* $(toPull(self)); | ||
yield* $(Effect.forkScoped(Effect.interruptible(Effect.forever(Effect.matchCauseEffect(pull, { | ||
yield* $(Effect.matchCauseEffect(pull, { | ||
onFailure: cause => Queue.offer(queue, Effect.failCause(cause)), | ||
@@ -318,9 +318,9 @@ onSuccess: either => Either.match(either, { | ||
yield* $(Effect.asUnit(Queue.offer(queue, Effect.map(Deferred.await(deferred), Either.right)))); | ||
yield* $(Effect.forkScoped(withPermits(1)(Effect.zipRight(Effect.intoDeferred(deferred)(Effect.tapErrorCause(cause => Deferred.failCause(errorSignal, cause))(Effect.uninterruptibleMask(restore => | ||
yield* $(Deferred.succeed(latch, void 0), Effect.zipRight(Effect.intoDeferred(deferred)(Effect.tapErrorCause(cause => Deferred.failCause(errorSignal, cause))(Effect.uninterruptibleMask(restore => | ||
// TODO: remove | ||
Effect.flatMap(exit => Effect.suspend(() => exit))(Effect.raceFirst(Effect.exit(restore(f(outElem))))(Effect.exit(restore(Deferred.await(errorSignal)))))))))(Deferred.succeed(latch, void 0))))); | ||
Effect.flatMap(exit => Effect.suspend(() => exit))(Effect.raceFirst(Effect.exit(restore(f(outElem))))(Effect.exit(restore(Deferred.await(errorSignal))))))))), withPermits(1), Effect.forkScoped); | ||
yield* $(Deferred.await(latch)); | ||
}) | ||
}) | ||
}))))); | ||
}), Effect.forever, Effect.interruptible, Effect.forkScoped); | ||
return queue; | ||
@@ -377,3 +377,3 @@ })))); | ||
}))))); | ||
yield* $(Effect.forkScoped(Effect.repeatWhile(_Function.identity)(Effect.matchCauseEffect(pull, { | ||
yield* $(Effect.matchCauseEffect(pull, { | ||
onFailure: cause => Effect.zipRight(Effect.succeed(false))(Queue.offer(queue, Effect.failCause(cause))), | ||
@@ -392,3 +392,3 @@ onSuccess: Either.match({ | ||
const raceEffects = Effect.scoped(Effect.flatMap(pull => Effect.race(Deferred.await(errorSignal))(evaluatePull(pull)))(toPull(core.pipeTo(channel)(queueReader)))); | ||
yield* $(Effect.forkScoped(withPermits(1)(Effect.zipRight(raceEffects)(Deferred.succeed(latch, void 0))))); | ||
yield* $(Deferred.succeed(latch, void 0), Effect.zipRight(raceEffects), withPermits(1), Effect.forkScoped); | ||
yield* $(Deferred.await(latch)); | ||
@@ -402,6 +402,6 @@ const errored = yield* $(Deferred.isDone(errorSignal)); | ||
const size = yield* $(Queue.size(cancelers)); | ||
yield* $(Effect.when(() => concurrency === "unbounded" ? false : size >= concurrency)(Effect.flatMap(_ => Deferred.succeed(_, void 0))(Queue.take(cancelers)))); | ||
yield* $(Queue.take(cancelers), Effect.flatMap(_ => Deferred.succeed(_, void 0)), Effect.when(() => concurrency === "unbounded" ? false : size >= concurrency)); | ||
yield* $(Queue.offer(cancelers, canceler)); | ||
const raceEffects = Effect.scoped(Effect.flatMap(pull => Effect.race(Deferred.await(canceler))(Effect.race(Deferred.await(errorSignal))(evaluatePull(pull))))(toPull(core.pipeTo(channel)(queueReader)))); | ||
yield* $(Effect.forkScoped(withPermits(1)(Effect.zipRight(raceEffects)(Deferred.succeed(latch, void 0))))); | ||
yield* $(Deferred.succeed(latch, void 0), Effect.zipRight(raceEffects), withPermits(1), Effect.forkScoped); | ||
yield* $(Deferred.await(latch)); | ||
@@ -413,3 +413,3 @@ const errored = yield* $(Deferred.isDone(errorSignal)); | ||
}) | ||
})))); | ||
}), Effect.repeatWhile(_Function.identity), Effect.forkScoped); | ||
return [queue, input]; | ||
@@ -631,2 +631,5 @@ }))); | ||
exports.updateService = updateService; | ||
const withSpan = /*#__PURE__*/(0, _Function.dual)(3, (self, name, options) => unwrapScoped(Effect.as(Effect.withSpanScoped(name, options), self))); | ||
/** @internal */ | ||
exports.withSpan = withSpan; | ||
const writeAll = (...outs) => writeChunk(Chunk.fromIterable(outs)); | ||
@@ -633,0 +636,0 @@ /** @internal */ |
@@ -81,3 +81,3 @@ "use strict"; | ||
const ref = yield* $(Ref.make(new Map())); | ||
const add = yield* $(stream.distributedWithDynamicCallback(options?.bufferSize ?? 16, ([key, value]) => Effect.flatMap(Deferred.await(decider), f => f(key, value)), exit => Queue.offer(output, exit))(stream.mapEffectSequential(self, f))); | ||
const add = yield* $(stream.mapEffectSequential(self, f), stream.distributedWithDynamicCallback(options?.bufferSize ?? 16, ([key, value]) => Effect.flatMap(Deferred.await(decider), f => f(key, value)), exit => Queue.offer(output, exit))); | ||
yield* $(Deferred.succeed(decider, (key, _) => Effect.flatMap(Option.match({ | ||
@@ -125,2 +125,5 @@ onNone: () => Effect.flatMap(add, ([index, queue]) => Effect.zipRight(Ref.update(ref, map => map.set(key, index)), Effect.as(n => n === index)(Queue.offer(output, Exit.succeed([key, mapDequeue(queue, exit => new take.TakeImpl(Exit.map(tuple => Chunk.of(tuple[1]))(exit)))]))))), | ||
} | ||
unsafeSize() { | ||
return this.dequeue.unsafeSize(); | ||
} | ||
awaitShutdown() { | ||
@@ -127,0 +130,0 @@ return Queue.awaitShutdown(this.dequeue); |
@@ -203,3 +203,3 @@ "use strict"; | ||
exports.contramap = contramap; | ||
const contramapEffect = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => contramapChunksEffect(self, chunk => Effect.map(Effect.forEach(chunk, f), Chunk.unsafeFromArray))); | ||
const contramapEffect = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => contramapChunksEffect(self, chunk => Effect.map(Effect.forEach(chunk, v => f(v)), Chunk.unsafeFromArray))); | ||
/** @internal */ | ||
@@ -614,3 +614,3 @@ exports.contramapEffect = contramapEffect; | ||
const process = core.readWithCause({ | ||
onInput: input => core.flatMap(() => process)(core.fromEffect(Effect.forEach(input, f, { | ||
onInput: input => core.flatMap(() => process)(core.fromEffect(Effect.forEach(input, v => f(v), { | ||
discard: true | ||
@@ -617,0 +617,0 @@ }))), |
@@ -14,3 +14,3 @@ "use strict"; | ||
var Ref = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Ref")); | ||
var Synchronized = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Ref/Synchronized")); | ||
var Synchronized = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/SynchronizedRef")); | ||
var stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/internal/stream")); | ||
@@ -56,3 +56,3 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
} | ||
_a = Ref.RefTypeId, _b = Synchronized.SynchronizedTypeId, _c = SubscriptionRefTypeId; | ||
_a = Ref.RefTypeId, _b = Synchronized.SynchronizedRefTypeId, _c = SubscriptionRefTypeId; | ||
/** @internal */ | ||
@@ -59,0 +59,0 @@ const get = self => Ref.get(self.ref); |
{ | ||
"name": "@effect/stream", | ||
"version": "0.34.0", | ||
"version": "0.35.0", | ||
"description": "Functional programming in TypeScript", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -165,9 +165,7 @@ import * as Chunk from "@effect/data/Chunk" | ||
const add = yield* $( | ||
pipe( | ||
stream.mapEffectSequential(self, f), | ||
stream.distributedWithDynamicCallback( | ||
options?.bufferSize ?? 16, | ||
([key, value]) => Effect.flatMap(Deferred.await(decider), (f) => f(key, value)), | ||
(exit) => Queue.offer(output, exit) | ||
) | ||
stream.mapEffectSequential(self, f), | ||
stream.distributedWithDynamicCallback( | ||
options?.bufferSize ?? 16, | ||
([key, value]) => Effect.flatMap(Deferred.await(decider), (f) => f(key, value)), | ||
(exit) => Queue.offer(output, exit) | ||
) | ||
@@ -341,2 +339,6 @@ ) | ||
unsafeSize(): Option.Option<number> { | ||
return this.dequeue.unsafeSize() | ||
} | ||
awaitShutdown(): Effect.Effect<never, never, void> { | ||
@@ -343,0 +345,0 @@ return Queue.awaitShutdown(this.dequeue) |
@@ -8,3 +8,3 @@ import { dual, pipe } from "@effect/data/Function" | ||
import * as Ref from "@effect/io/Ref" | ||
import * as Synchronized from "@effect/io/Ref/Synchronized" | ||
import * as Synchronized from "@effect/io/SynchronizedRef" | ||
import * as stream from "@effect/stream/internal/stream" | ||
@@ -32,3 +32,3 @@ import type { Stream } from "@effect/stream/Stream" | ||
// @ts-ignore | ||
readonly [Synchronized.SynchronizedTypeId] = _circular.synchronizedVariance | ||
readonly [Synchronized.SynchronizedRefTypeId] = _circular.synchronizedVariance | ||
readonly [SubscriptionRefTypeId] = subscriptionRefVariance | ||
@@ -35,0 +35,0 @@ constructor( |
@@ -9,3 +9,3 @@ /** | ||
import * as Ref from "@effect/io/Ref" | ||
import * as Synchronized from "@effect/io/Ref/Synchronized" | ||
import * as Synchronized from "@effect/io/SynchronizedRef" | ||
import * as internal from "@effect/stream/internal/subscriptionRef" | ||
@@ -33,3 +33,3 @@ import type * as Stream from "@effect/stream/Stream" | ||
*/ | ||
export interface SubscriptionRef<A> extends SubscriptionRef.Variance<A>, Synchronized.Synchronized<A>, Pipeable { | ||
export interface SubscriptionRef<A> extends SubscriptionRef.Variance<A>, Synchronized.SynchronizedRef<A>, Pipeable { | ||
/** @internal */ | ||
@@ -92,4 +92,4 @@ readonly ref: Ref.Ref<A> | ||
export const getAndUpdateEffect: { | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, A> | ||
<A, R, E>(self: Synchronized.Synchronized<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A> | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, A> | ||
<A, R, E>(self: SubscriptionRef<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A> | ||
} = Synchronized.getAndUpdateEffect | ||
@@ -113,5 +113,5 @@ | ||
pf: (a: A) => Option.Option<Effect.Effect<R, E, A>> | ||
): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, A> | ||
): (self: SubscriptionRef<A>) => Effect.Effect<R, E, A> | ||
<A, R, E>( | ||
self: Synchronized.Synchronized<A>, | ||
self: SubscriptionRef<A>, | ||
pf: (a: A) => Option.Option<Effect.Effect<R, E, A>> | ||
@@ -171,5 +171,5 @@ ): Effect.Effect<R, E, A> | ||
pf: (a: A) => Option.Option<Effect.Effect<R, E, readonly [B, A]>> | ||
): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, B> | ||
): (self: SubscriptionRef<A>) => Effect.Effect<R, E, B> | ||
<A, B, R, E>( | ||
self: Synchronized.Synchronized<A>, | ||
self: SubscriptionRef<A>, | ||
fallback: B, | ||
@@ -212,4 +212,4 @@ pf: (a: A) => Option.Option<Effect.Effect<R, E, readonly [B, A]>> | ||
export const updateEffect: { | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, void> | ||
<A, R, E>(self: Synchronized.Synchronized<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, void> | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, void> | ||
<A, R, E>(self: SubscriptionRef<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, void> | ||
} = Synchronized.updateEffect | ||
@@ -231,4 +231,4 @@ | ||
export const updateAndGetEffect: { | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, A> | ||
<A, R, E>(self: Synchronized.Synchronized<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A> | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, A> | ||
<A, R, E>(self: SubscriptionRef<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A> | ||
} = Synchronized.updateAndGetEffect | ||
@@ -254,3 +254,3 @@ | ||
<A, R, E>( | ||
self: Synchronized.Synchronized<A>, | ||
self: SubscriptionRef<A>, | ||
pf: (a: A) => Option.Option<Effect.Effect<R, E, A>> | ||
@@ -276,7 +276,7 @@ ): Effect.Effect<R, E, void> | ||
pf: (a: A) => Option.Option<Effect.Effect<R, E, A>> | ||
): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, A> | ||
): (self: SubscriptionRef<A>) => Effect.Effect<R, E, A> | ||
<A, R, E>( | ||
self: Synchronized.Synchronized<A>, | ||
self: SubscriptionRef<A>, | ||
pf: (a: A) => Option.Option<Effect.Effect<R, E, A>> | ||
): Effect.Effect<R, E, A> | ||
} = Synchronized.updateSomeAndGetEffect |
@@ -7,3 +7,3 @@ /** | ||
import type * as Effect from "@effect/io/Effect"; | ||
import * as Synchronized from "@effect/io/Ref/Synchronized"; | ||
import * as Synchronized from "@effect/io/SynchronizedRef"; | ||
import type * as Stream from "@effect/stream/Stream"; | ||
@@ -27,3 +27,3 @@ /** | ||
*/ | ||
export interface SubscriptionRef<A> extends SubscriptionRef.Variance<A>, Synchronized.Synchronized<A>, Pipeable { | ||
export interface SubscriptionRef<A> extends SubscriptionRef.Variance<A>, Synchronized.SynchronizedRef<A>, Pipeable { | ||
/** | ||
@@ -75,4 +75,4 @@ * A stream containing the current value of the `Ref` as well as all changes | ||
export declare const getAndUpdateEffect: { | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, A>; | ||
<A, R, E>(self: Synchronized.Synchronized<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A>; | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, A>; | ||
<A, R, E>(self: SubscriptionRef<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A>; | ||
}; | ||
@@ -92,4 +92,4 @@ /** | ||
export declare const getAndUpdateSomeEffect: { | ||
<A, R, E>(pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, A>; | ||
<A, R, E>(self: Synchronized.Synchronized<A>, pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): Effect.Effect<R, E, A>; | ||
<A, R, E>(pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, A>; | ||
<A, R, E>(self: SubscriptionRef<A>, pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): Effect.Effect<R, E, A>; | ||
}; | ||
@@ -132,4 +132,4 @@ /** | ||
export declare const modifySomeEffect: { | ||
<A, B, R, E>(fallback: B, pf: (a: A) => Option.Option<Effect.Effect<R, E, readonly [B, A]>>): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, B>; | ||
<A, B, R, E>(self: Synchronized.Synchronized<A>, fallback: B, pf: (a: A) => Option.Option<Effect.Effect<R, E, readonly [B, A]>>): Effect.Effect<R, E, B>; | ||
<A, B, R, E>(fallback: B, pf: (a: A) => Option.Option<Effect.Effect<R, E, readonly [B, A]>>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, B>; | ||
<A, B, R, E>(self: SubscriptionRef<A>, fallback: B, pf: (a: A) => Option.Option<Effect.Effect<R, E, readonly [B, A]>>): Effect.Effect<R, E, B>; | ||
}; | ||
@@ -165,4 +165,4 @@ /** | ||
export declare const updateEffect: { | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, void>; | ||
<A, R, E>(self: Synchronized.Synchronized<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, void>; | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, void>; | ||
<A, R, E>(self: SubscriptionRef<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, void>; | ||
}; | ||
@@ -182,4 +182,4 @@ /** | ||
export declare const updateAndGetEffect: { | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, A>; | ||
<A, R, E>(self: Synchronized.Synchronized<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A>; | ||
<A, R, E>(f: (a: A) => Effect.Effect<R, E, A>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, A>; | ||
<A, R, E>(self: SubscriptionRef<A>, f: (a: A) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A>; | ||
}; | ||
@@ -200,3 +200,3 @@ /** | ||
<A, R, E>(pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, void>; | ||
<A, R, E>(self: Synchronized.Synchronized<A>, pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): Effect.Effect<R, E, void>; | ||
<A, R, E>(self: SubscriptionRef<A>, pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): Effect.Effect<R, E, void>; | ||
}; | ||
@@ -216,5 +216,5 @@ /** | ||
export declare const updateSomeAndGetEffect: { | ||
<A, R, E>(pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): (self: Synchronized.Synchronized<A>) => Effect.Effect<R, E, A>; | ||
<A, R, E>(self: Synchronized.Synchronized<A>, pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): Effect.Effect<R, E, A>; | ||
<A, R, E>(pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): (self: SubscriptionRef<A>) => Effect.Effect<R, E, A>; | ||
<A, R, E>(self: SubscriptionRef<A>, pf: (a: A) => Option.Option<Effect.Effect<R, E, A>>): Effect.Effect<R, E, A>; | ||
}; | ||
//# sourceMappingURL=SubscriptionRef.d.ts.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
var Ref = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Ref")); | ||
var Synchronized = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Ref/Synchronized")); | ||
var Synchronized = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/SynchronizedRef")); | ||
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/internal/subscriptionRef")); | ||
@@ -11,0 +11,0 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3445725
58188