# collectUpToFork

Forks the collection of up to `n` values from an `Fx`.

## Signatures

```ts
export declare const collectUpToFork: <A, E = never, R = never>(fx: Fx<A, E, R>, upTo: number) => Effect.Effect<Fiber.Fiber<ReadonlyArray<A>, E>, never, R>;
```

## Why

A bounded collection can run concurrently while the caller keeps control through
the returned fiber.

## Ownership and lifetime

Running the Effect starts a supervised child immediately. It retains at most
`upTo` values, stops upstream at the bound, and is interrupted when its parent
terminates. Source failures are reported by the child fiber.

## Examples

```ts
import { Effect, Fiber } from "effect"
import { collectUpToFork, periodic } from "@typed/fx/Fx"

const program = Effect.gen(function* () {
  const fiber = yield* collectUpToFork(periodic("10 millis"), 2)
  return yield* Fiber.join(fiber)
})
```
