![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.quebec/private_html/node_modules/effect/src/ |
/**
* @since 2.0.0
*/
import type { LazyArg } from "./Function.js"
import * as internal from "./internal/executionStrategy.js"
/**
* Describes a strategy for evaluating multiple effects, potentially in
* parallel.
*
* There are 3 possible execution strategies: `Sequential`, `Parallel`,
* `ParallelN`.
*
* @since 2.0.0
* @category models
*/
export type ExecutionStrategy = Sequential | Parallel | ParallelN
/**
* Execute effects sequentially.
*
* @since 2.0.0
* @category models
*/
export interface Sequential {
readonly _tag: "Sequential"
}
/**
* Execute effects in parallel.
*
* @since 2.0.0
* @category models
*/
export interface Parallel {
readonly _tag: "Parallel"
}
/**
* Execute effects in parallel, up to the specified number of concurrent fibers.
*
* @since 2.0.0
* @category models
*/
export interface ParallelN {
readonly _tag: "ParallelN"
readonly parallelism: number
}
/**
* Execute effects sequentially.
*
* @since 2.0.0
* @category constructors
*/
export const sequential: ExecutionStrategy = internal.sequential
/**
* Execute effects in parallel.
*
* @since 2.0.0
* @category constructors
*/
export const parallel: ExecutionStrategy = internal.parallel
/**
* Execute effects in parallel, up to the specified number of concurrent fibers.
*
* @since 2.0.0
* @category constructors
*/
export const parallelN: (parallelism: number) => ExecutionStrategy = internal.parallelN
/**
* Returns `true` if the specified `ExecutionStrategy` is an instance of
* `Sequential`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isSequential: (self: ExecutionStrategy) => self is Sequential = internal.isSequential
/**
* Returns `true` if the specified `ExecutionStrategy` is an instance of
* `Sequential`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isParallel: (self: ExecutionStrategy) => self is Parallel = internal.isParallel
/**
* Returns `true` if the specified `ExecutionStrategy` is an instance of
* `Sequential`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isParallelN: (self: ExecutionStrategy) => self is ParallelN = internal.isParallelN
/**
* Folds over the specified `ExecutionStrategy` using the provided case
* functions.
*
* @since 2.0.0
* @category folding
*/
export const match: {
/**
* Folds over the specified `ExecutionStrategy` using the provided case
* functions.
*
* @since 2.0.0
* @category folding
*/
<A>(
options: {
readonly onSequential: LazyArg<A>
readonly onParallel: LazyArg<A>
readonly onParallelN: (n: number) => A
}
): (self: ExecutionStrategy) => A
/**
* Folds over the specified `ExecutionStrategy` using the provided case
* functions.
*
* @since 2.0.0
* @category folding
*/
<A>(
self: ExecutionStrategy,
options: {
readonly onSequential: LazyArg<A>
readonly onParallel: LazyArg<A>
readonly onParallelN: (n: number) => A
}
): A
} = internal.match