# Tunnels

tunnel carries typed values between concurrent work with capacity-one FIFO handoff and backpressure.

Last updated: 2026-09-09

Package: language | Status: experimental

Tags: Receive, Send, concurrency, cpu, hasValue, language, of, tunnel, yeho

Use a tunnel when producers and consumers should communicate without sharing an unbounded mutable queue.

```yh
tunnel of Type name
tunnel<Type> name
name.Send(value)
name.Receive()
```


## Complete tunnels example

Use a tunnel when producers and consumers should communicate without sharing an unbounded mutable queue.

Verification: type checked

```yh
tunnel of text messages
messages.Send("Player joined")
text message = messages.Receive()
Console.Log(message)

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.language__tunnels"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/language--tunnels/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


The channel keyword was removed. Use tunnel.

Tunnels are capacity one, FIFO, and backpressured in the current contract.

Source: yeho/errors-tasks-effects-2026.1.json; tests/compiler/errors-tasks-effects/tunnel-handoff/start.yh

AI training permission: https://demonhunterlabs.com/ai-use
