nustack
ReferenceFabrics

nu.mem

In-process fabric adapter: plain nested Python dicts as the data bag. No storage backend, no views, no reactivity — just dicts. Concrete Ref implementations for the shape Ref blueprints (nu.shape.refs), plus a janus-backed queue ref for bridging asyncio and threads.

Base

from nu.mem import RefBase

NameSortSignatureEffectMeaning
RefBaseclassRefBase(address, *, parent_ref=None, owner_shape=None)read/writedict-substrate base: resolves the on-tree parent chain at runtime, no backend

Items

from nu.mem import ItemRef, IntRef, StrRef, FloatRef, BoolRef, BytesRef

NameSortSignatureEffectMeaning
ItemRefclassItemRef(address, *, value_type, value_value_type, parent_ref=None, owner_shape=None)read/writegeneric typed value holder in a nested dict slot
IntRefclassIntRef(address, *, parent_ref=None, owner_shape=None)read/writedict integer ref with full numeric interface (Int mixin); adds inc/dec
StrRefclassStrRef(address, *, parent_ref=None, owner_shape=None)read/writedict string ref with full string interface (Str mixin)
FloatRefclassFloatRef(address, *, parent_ref=None, owner_shape=None)read/writedict float ref with full numeric interface (Float mixin)
BoolRefclassBoolRef(address, *, parent_ref=None, owner_shape=None)read/writedict boolean ref with full logical interface (Bool mixin)
BytesRefclassBytesRef(address, *, parent_ref=None, owner_shape=None)read/writedict bytes ref with full bytes interface (Bytes mixin)

Dict

from nu.mem import DictRef

NameSortSignatureEffectMeaning
DictRefclassDictRef(address, *, value_type, key_type, key_value_type, value_value_type, parent_ref=None, owner_shape=None)read/writekey-value mapping container backed by a nested dict

Dict Shapes

from nu.mem import ShapesDictRef

NameSortSignatureEffectMeaning
ShapesDictRefclassShapesDictRef(address, *, shape_type, key_type, key_value_type, parent_ref=None, owner_shape=None)read/writemapping of homogeneous shapes; key descent yields a ShapeRef

List

from nu.mem import ListRef

NameSortSignatureEffectMeaning
ListRefclassListRef(address, *, item_type, item_value_type, parent_ref=None, owner_shape=None)read/writeordered element container backed by a nested list

List Shapes

from nu.mem import ShapesListRef

NameSortSignatureEffectMeaning
ShapesListRefclassShapesListRef(address, *, shape_type, parent_ref=None, owner_shape=None)read/writesequence of homogeneous shapes; index descent yields a ShapeRef

Set

from nu.mem import SetRef

NameSortSignatureEffectMeaning
SetRefclassSetRef(address, *, item_type, parent_ref=None, owner_shape=None)read/writeunordered unique-element container backed by a nested set

Shape

from nu.mem import ShapeRef

NameSortSignatureEffectMeaning
ShapeRefclassShapeRef(address, *, shape_type, parent_ref=None, owner_shape=None)read/writestructured named-slot container backed by a nested dict; field descent yields each field's typed mem ref

Stdlib

from nu.mem import BasisPointRef, ComplexRef, DateRef, DatetimeRef, DecimalRef, FractionRef, PathRef, PercentageRef, TimeRef, TimedeltaRef, TimezoneRef, UUIDRef

Typed refs for standard-library value types. Each stores a domain value in a different on-disk shape (store/coerce convert between them) and mixes in the matching nu.std Form for its operator interface, same pattern as IntRef.

NameSortSignatureEffectMeaning
DecimalRefclassDecimalRef(address, *, parent_ref=None, owner_shape=None)read/writeDecimal ref, stored as str
FractionRefclassFractionRef(address, *, parent_ref=None, owner_shape=None)read/writeFraction ref, stored as str
ComplexRefclassComplexRef(address, *, parent_ref=None, owner_shape=None)read/writecomplex ref, stored as str
BasisPointRefclassBasisPointRef(address, *, parent_ref=None, owner_shape=None)read/writebasis-point ref, stored as raw int
PercentageRefclassPercentageRef(address, *, parent_ref=None, owner_shape=None)read/writepercentage ref, stored as raw float
DateRefclassDateRef(address, *, parent_ref=None, owner_shape=None)read/writedate ref, stored as ISO str
DatetimeRefclassDatetimeRef(address, *, parent_ref=None, owner_shape=None)read/writedatetime ref, stored as ISO str
TimeRefclassTimeRef(address, *, parent_ref=None, owner_shape=None)read/writetime ref, stored as ISO str
TimedeltaRefclassTimedeltaRef(address, *, parent_ref=None, owner_shape=None)read/writetimedelta ref, stored as total seconds (float)
TimezoneRefclassTimezoneRef(address, *, parent_ref=None, owner_shape=None)read/writetimezone ref, stored as offset str
PathRefclassPathRef(address, *, parent_ref=None, owner_shape=None)read/writePath ref, stored as str
UUIDRefclassUUIDRef(address, *, parent_ref=None, owner_shape=None)read/writeUUID ref, stored as str

JQueue

from nu.mem.refs.jqueue import JQueue — optional dep nu-mem[jqueue]; not yet re-exported flat at nu.mem (deferred pass, lands with the v2 substrate seam).

NameSortSignatureEffectMeaning
JQueueFormJQueue(node)puretyped surface over a janus-backed queue ref; put/get/qsize/close build interaction trees over the wrapped node

JQueue Ref

from nu.mem.refs.jqueue import JQueueRef

NameSortSignatureEffectMeaning
JQueueRefclassJQueueRef(address, *, parent_ref=None, owner_shape=None, capacity=None, item_type=object)read/writeleaf ref to a janus.Queue; vivifies it at the slot's path on first fetch, then returns the same instance

JQueue Interactions

from nu.mem.refs.jqueue import Put, Get, QSize, Close, QueueClosed

NameSortSignatureEffectMeaning
PutScalarCommandPut(queue, value)mutates slot 0enqueue value; blocks when full (back-pressure)
GetScalarActionGet(queue)mutates slot 0pop one value; blocks when empty; mutating producer, so Action not Query
QSizeScalarQueryQSize(queue)puresnapshot item count
CloseScalarCommandClose(queue)mutates slot 0shut down both queue halves

QueueClosed (Exception) — raised by Get when shut down and empty, or by Put when shut down.

Tree passes

from nu.mem import inline_refs

NameSortSignatureEffectMeaning
inline_refsfninline_refs(tree)pureretired no-op; runtime path resolution (parent-on-tree) superseded ref flattening

On this page