On this page

Dynamic mode and linking conduits๏ƒ

Intermediate. Everything above works without this. Turn it on when separate parts of your system need to share.

By default a world is static โ€” bind, conjure, resolve. Turn on dynamic mode and conduits gain the ability to connect to each other at runtime.

The mode is decided once, by the first conjure, and then inherited:

# SETTLEMENT โ€” the first conjure on a fresh world sets the mode, and it locks
owner = owner_book.conjure(dynamic=True, name="owner")

# INHERITANCE โ€” later books just attach; a plain conjure() inherits the mode.
# You never repeat the flag.
borrower = borrower_book.conjure(name="borrower")

Now link them and share a spell across the boundary:

owner.link(borrower)                       # open a contract between the two

borrower.add_spell_to_contract(            # โ† the BORROWER asks
    spell_id=spell_id,
    conduit=owner,                         # โ† from the conduit that OWNS it
    permissions="create",
)

shared = borrower.meld("SharedDirectory")   # resolves the owner's spell

Sharing is a pull, never a push. The conduit that wants the spell asks for it, and names the owner. An owner cannot force its objects into someone else's scope โ€” so nothing arrives in your conduit that you didn't request.

Runnable examples๏ƒ

All intermediate examples ยท Level contents ยท Full contents

Canonical page source