# Fiber

`import { Fiber } from "destack:async";`

Cooperative execution on the current Worker.

A fiber handle names one parked or running execution for wake delivery.
Handles are plain identities: copying one never copies the execution.

```ds title="Fiber"
export struct Fiber {
    static current(): Fiber;
    static park<T>(): T;
    wake<T>(value: T): void;
    static spawn(body: () => void): void;
}
```

[language/library/src/async/fiber.ds:8:33](https://github.com/destack-sh/destack/blob/main/language/library/src/async/fiber.ds#L8-L33)

## Members

### `static current(): Fiber`

Return the currently executing fiber.

### `static park<T>(): T`

Park the current fiber until one wake delivers a value.

### `wake<T>(value: T): void`

Deliver one wake value to this fiber.

A wake sent before the target parks is buffered for its next park.

### `static spawn(body: () => void): void`

Queue one thunk to run on a fresh fiber.
