Fabric
A Fabric is an addressable space where Refs live. It owns a slice of the world and knows how to resolve addresses inside that slice.
What a Fabric provides
- an address space - what its Refs can name;
- a resolution capability - how to turn a Ref into a read, write, or Action against the underlying resource.
The minimal surface a Fabric answers:
- read - value at an address;
- write - place a value at an address;
- list - enumerate addresses under a subpath (where applicable);
- delete - remove an address (where applicable).
Not every Fabric offers every capability. A read-only http Fabric has no write; an append-only log Fabric has no delete. The Fabric declares what it supports; Refs into it inherit those limits.
Examples
| Fabric | Address space | Reads | Writes |
|---|---|---|---|
| in-memory dict | keys | dict lookup | dict assignment |
| filesystem | paths | file read | file write |
| http api | URLs | GET | POST / PUT / DELETE |
| sql database | table + row + column | SELECT | INSERT / UPDATE / DELETE |
| kv store | keys | GET | PUT / DEL |
| message queue | queue name | receive | send |
Each of these is a Fabric. The Ref carries the address; the Fabric carries out the resolution.
Not a citizen of the model
A Fabric is not a Nu atom. It lives one layer below - Refs and Interactions are the model's citizens, Fabrics are the machinery underneath that makes them do anything.