On this page

Choose an instance lifetime๏ƒ

Beginner. Pick how long things live.

Existence

One instance per

Use it for

๐ŸŸข

unique

Process (frame)

Config, pools, caches

๐ŸŸข

unique_per_conduit

Scope

Request / session state

๐ŸŸข

many

Nothing โ€” new every meld

Stateless workers, DTOs

๐ŸŸก

unique_per_conduit_lineage

A scope and its children

Shared context down a tree

๐ŸŸก

unique_per_spell_space

A request-local space

Ephemeral request scoping

๐ŸŸก

managed_spell_quantity

Nothing โ€” leased from a pool the root keeps

Costly objects reused across holders

๐ŸŸ 

unique_per_conduit_cluster

A named group of scopes

Cross-scope coordination

The first three are the beginner set โ€” they cover most systems and need nothing but a static conjure. The rest arrive with the need that gives them meaning: lineage and spell spaces once you have nested scopes, managed pools once an object costs more to build than to lend, clusters once conduits link into groups.

For the intermediate leasing and release example, see Managed Spell Quantities.

Callables are always unique. Want a fresh object every time? Bind a class as many.

Runnable examples๏ƒ

All beginner examples ยท Level contents ยท Full contents

Canonical page source