# Fx.fork

Forks the execution of an `Fx` into a background fiber.
The stream will run until it completes or the fiber is interrupted.

## Signatures

```ts
export declare const fork: <A, E, R>(fx: Fx<A, E, R>, options?: {
    readonly startImmediately?: boolean;
    readonly uninterruptible?: boolean;
}) => Effect<Fiber<unknown, E>, never, R>;
```

## Why

`fork` keeps background execution inside Effect's supervised fiber tree while
returning an explicit handle for coordination.

## Ownership and lifetime

The returned Effect acquires the source services and creates a child attached to
the calling fiber's scope. Parent termination interrupts the child. By default the
child starts immediately and remains interruptible; `options` can change those two
Effect fiber policies. Values are discarded and source failure is reported by the
child fiber.

## Examples

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

const program = Effect.gen(function* () {
  const fiber = yield* fork(periodic("1 second"))
  return yield* Fiber.interrupt(fiber)
})
```
