# recipes/two-clients

Two people editing one document at once, including what happens when they write the same slot and who yields.

Recipe: two clients editing one document.

The question this answers is what happens when two people type at once. Both ends are the same code, the link is symmetric, and neither end is the authority. It runs in one process over the in-process channel, which behaves exactly as a socket does: delivery is always asynchronous, so a test that does not wait is a test that passes by accident.

## Files

- [`main.ts`](/docs/recipes/two-clients/files/main.ts)
