@effect/io
Advanced tools
Comparing version 0.29.5 to 0.30.0
@@ -36,3 +36,3 @@ "use strict"; | ||
const fiberRuntime = new FiberRuntime.FiberRuntime(fiberId, FiberRefs.forkAs(fiberRefs, fiberId), runtime.runtimeFlags); | ||
const supervisor = fiberRuntime.getSupervisor(); | ||
const supervisor = fiberRuntime._supervisor; | ||
if (supervisor !== _supervisor.none) { | ||
@@ -39,0 +39,0 @@ supervisor.onStart(runtime.context, effect, Option.none(), fiberRuntime); |
@@ -20,2 +20,3 @@ import type * as Context from "@effect/data/Context"; | ||
zip<A>(right: Supervisor.Supervisor<A>): Supervisor.Supervisor<readonly [Array<Fiber.RuntimeFiber<any, any>>, A]>; | ||
onRun<E, A, X>(execution: () => X, _fiber: Fiber.RuntimeFiber<E, A>): X; | ||
} | ||
@@ -36,3 +37,4 @@ export declare class Const<T> implements Supervisor.Supervisor<T> { | ||
zip<A>(right: Supervisor.Supervisor<A>): Supervisor.Supervisor<readonly [T, A]>; | ||
onRun<E, A, X>(execution: () => X, _fiber: Fiber.RuntimeFiber<E, A>): X; | ||
} | ||
//# sourceMappingURL=supervisor.d.ts.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.unsafeTrack = exports.track = exports.none = exports.fromEffect = exports.fibersIn = exports.Zip = exports.Track = exports.SupervisorTypeId = exports.ProxySupervisor = exports.Const = void 0; | ||
exports.unsafeTrack = exports.track = exports.supervisorVariance = exports.none = exports.fromEffect = exports.fibersIn = exports.Zip = exports.Track = exports.SupervisorTypeId = exports.ProxySupervisor = exports.Const = void 0; | ||
var Debug = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Debug")); | ||
@@ -25,2 +25,3 @@ var MutableRef = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/MutableRef")); | ||
/** @internal */ | ||
exports.supervisorVariance = supervisorVariance; | ||
class ProxySupervisor { | ||
@@ -56,2 +57,5 @@ constructor(underlying, value0) { | ||
} | ||
onRun(execution, fiber) { | ||
return this.underlying.onRun(execution, fiber); | ||
} | ||
} | ||
@@ -96,2 +100,5 @@ exports.ProxySupervisor = ProxySupervisor; | ||
} | ||
onRun(execution, fiber) { | ||
return this.right.onRun(() => this.left.onRun(execution, fiber), fiber); | ||
} | ||
} | ||
@@ -129,2 +136,5 @@ exports.Zip = Zip; | ||
} | ||
onRun(execution, _fiber) { | ||
return execution(); | ||
} | ||
} | ||
@@ -162,2 +172,5 @@ exports.Track = Track; | ||
} | ||
onRun(execution, _fiber) { | ||
return execution(); | ||
} | ||
} | ||
@@ -195,2 +208,5 @@ exports.Const = Const; | ||
} | ||
onRun(execution, _fiber) { | ||
return execution(); | ||
} | ||
} | ||
@@ -197,0 +213,0 @@ _e = SupervisorTypeId; |
{ | ||
"name": "@effect/io", | ||
"version": "0.29.5", | ||
"version": "0.30.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -60,3 +60,3 @@ import * as Context from "@effect/data/Context" | ||
const supervisor = fiberRuntime.getSupervisor() | ||
const supervisor = fiberRuntime._supervisor | ||
@@ -63,0 +63,0 @@ if (supervisor !== _supervisor.none) { |
@@ -22,3 +22,3 @@ import type * as Context from "@effect/data/Context" | ||
/** @internal */ | ||
const supervisorVariance = { | ||
export const supervisorVariance = { | ||
_T: (_: never) => _ | ||
@@ -73,2 +73,6 @@ } | ||
} | ||
onRun<E, A, X>(execution: () => X, fiber: Fiber.RuntimeFiber<E, A>): X { | ||
return this.underlying.onRun(execution, fiber) | ||
} | ||
} | ||
@@ -128,5 +132,10 @@ | ||
} | ||
zip<A>(right: Supervisor.Supervisor<A>): Supervisor.Supervisor<readonly [readonly [T0, T1], A]> { | ||
return new Zip(this, right) | ||
} | ||
onRun<E, A, X>(execution: () => X, fiber: Fiber.RuntimeFiber<E, A>): X { | ||
return this.right.onRun(() => this.left.onRun(execution, fiber), fiber) | ||
} | ||
} | ||
@@ -177,2 +186,6 @@ | ||
} | ||
onRun<E, A, X>(execution: () => X, _fiber: Fiber.RuntimeFiber<E, A>): X { | ||
return execution() | ||
} | ||
} | ||
@@ -222,2 +235,6 @@ | ||
} | ||
onRun<E, A, X>(execution: () => X, _fiber: Fiber.RuntimeFiber<E, A>): X { | ||
return execution() | ||
} | ||
} | ||
@@ -269,2 +286,6 @@ | ||
} | ||
onRun<E, A, X>(execution: () => X, _fiber: Fiber.RuntimeFiber<E, A>): X { | ||
return execution() | ||
} | ||
} | ||
@@ -271,0 +292,0 @@ |
@@ -14,2 +14,3 @@ /** | ||
import type * as Fiber from "@effect/io/Fiber" | ||
import * as core from "@effect/io/internal_effect_untraced/core" | ||
import * as circular from "@effect/io/internal_effect_untraced/layer/circular" | ||
@@ -59,2 +60,7 @@ import * as internal from "@effect/io/internal_effect_untraced/supervisor" | ||
/** | ||
* Supervises the run of a `Fiber`. | ||
*/ | ||
onRun<E, A, X>(execution: () => X, fiber: Fiber.RuntimeFiber<E, A>): X | ||
/** | ||
* Supervises the execution of an `Effect` by a `Fiber`. | ||
@@ -151,1 +157,92 @@ */ | ||
export const unsafeTrack: () => Supervisor<Array<Fiber.RuntimeFiber<any, any>>> = internal.unsafeTrack | ||
/** | ||
* @since 1.0.0 | ||
* @category constructors | ||
*/ | ||
export abstract class AbstractSupervisor<T> implements Supervisor<T> { | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
abstract value(): Effect.Effect<never, never, T> | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onStart<R, E, A>( | ||
_context: Context.Context<R>, | ||
_effect: Effect.Effect<R, E, A>, | ||
_parent: Option.Option<Fiber.RuntimeFiber<any, any>>, | ||
_fiber: Fiber.RuntimeFiber<E, A> | ||
): void { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onEnd<E, A>( | ||
_value: Exit.Exit<E, A>, | ||
_fiber: Fiber.RuntimeFiber<E, A> | ||
): void { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onEffect<E, A>( | ||
_fiber: Fiber.RuntimeFiber<E, A>, | ||
_effect: Effect.Effect<any, any, any> | ||
): void { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onSuspend<E, A>( | ||
_fiber: Fiber.RuntimeFiber<E, A> | ||
): void { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onResume<E, A>( | ||
_fiber: Fiber.RuntimeFiber<E, A> | ||
): void { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
map<B>(f: (a: T) => B): Supervisor<B> { | ||
return new internal.ProxySupervisor(this, () => core.map(this.value(), f)) | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
zip<A>( | ||
right: Supervisor<A> | ||
): Supervisor<readonly [T, A]> { | ||
return new internal.Zip(this, right) | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onRun<E, A, X>(execution: () => X, _fiber: Fiber.RuntimeFiber<E, A>): X { | ||
return execution() | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
readonly [SupervisorTypeId]: { | ||
_T: (_: never) => never | ||
} = internal.supervisorVariance | ||
} |
@@ -45,2 +45,6 @@ /** | ||
/** | ||
* Supervises the run of a `Fiber`. | ||
*/ | ||
onRun<E, A, X>(execution: () => X, fiber: Fiber.RuntimeFiber<E, A>): X; | ||
/** | ||
* Supervises the execution of an `Effect` by a `Fiber`. | ||
@@ -123,2 +127,50 @@ */ | ||
export declare const unsafeTrack: () => Supervisor<Array<Fiber.RuntimeFiber<any, any>>>; | ||
/** | ||
* @since 1.0.0 | ||
* @category constructors | ||
*/ | ||
export declare abstract class AbstractSupervisor<T> implements Supervisor<T> { | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
abstract value(): Effect.Effect<never, never, T>; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onStart<R, E, A>(_context: Context.Context<R>, _effect: Effect.Effect<R, E, A>, _parent: Option.Option<Fiber.RuntimeFiber<any, any>>, _fiber: Fiber.RuntimeFiber<E, A>): void; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onEnd<E, A>(_value: Exit.Exit<E, A>, _fiber: Fiber.RuntimeFiber<E, A>): void; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onEffect<E, A>(_fiber: Fiber.RuntimeFiber<E, A>, _effect: Effect.Effect<any, any, any>): void; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onSuspend<E, A>(_fiber: Fiber.RuntimeFiber<E, A>): void; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onResume<E, A>(_fiber: Fiber.RuntimeFiber<E, A>): void; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
map<B>(f: (a: T) => B): Supervisor<B>; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
zip<A>(right: Supervisor<A>): Supervisor<readonly [T, A]>; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onRun<E, A, X>(execution: () => X, _fiber: Fiber.RuntimeFiber<E, A>): X; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
readonly [SupervisorTypeId]: { | ||
_T: (_: never) => never; | ||
}; | ||
} | ||
//# sourceMappingURL=Supervisor.d.ts.map |
@@ -6,3 +6,4 @@ "use strict"; | ||
}); | ||
exports.unsafeTrack = exports.track = exports.none = exports.fromEffect = exports.fibersIn = exports.addSupervisor = exports.SupervisorTypeId = void 0; | ||
exports.unsafeTrack = exports.track = exports.none = exports.fromEffect = exports.fibersIn = exports.addSupervisor = exports.SupervisorTypeId = exports.AbstractSupervisor = void 0; | ||
var core = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal_effect_untraced/core")); | ||
var circular = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal_effect_untraced/layer/circular")); | ||
@@ -12,2 +13,3 @@ var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal_effect_untraced/supervisor")); | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var _a; | ||
/** | ||
@@ -64,3 +66,65 @@ * @since 1.0.0 | ||
const unsafeTrack = internal.unsafeTrack; | ||
/** | ||
* @since 1.0.0 | ||
* @category constructors | ||
*/ | ||
exports.unsafeTrack = unsafeTrack; | ||
class AbstractSupervisor { | ||
constructor() { | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
this[_a] = internal.supervisorVariance; | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onStart(_context, _effect, _parent, _fiber) { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onEnd(_value, _fiber) { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onEffect(_fiber, _effect) { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onSuspend(_fiber) { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onResume(_fiber) { | ||
// | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
map(f) { | ||
return new internal.ProxySupervisor(this, () => core.map(this.value(), f)); | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
zip(right) { | ||
return new internal.Zip(this, right); | ||
} | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
onRun(execution, _fiber) { | ||
return execution(); | ||
} | ||
} | ||
exports.AbstractSupervisor = AbstractSupervisor; | ||
_a = SupervisorTypeId; | ||
//# sourceMappingURL=Supervisor.js.map |
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 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
6972931
119763