const classafConcurrent::LocalRef
sys::Obj afConcurrent::LocalRef
@Js
Manages an Obj reference stored in Actor.locals with a unique key.
- cleanUp
- Void cleanUp()- Removes this object from - Actor.locals.
- isMapped
- Bool isMapped()- Returns - trueif- Actor.localsholds an entry for this- qname.
- makeWithFunc
- new makeWithFunc(Str name, |->Obj?? defFunc := null)- Creates a - LocalRefwith given name.- If not null, - defFuncis called to create a default object whenever- valis read and a value is not mapped in- Actor.locals. This object is then stored and returned. This allows the creation of non-const default objects in multiple threads.- initFuncmust be immutable.
- name
- const Str name- The variable name given to the ctor. 
- qname
- const Str qname- The qualified name this - ThreadLocalis stored under in- Actor.locals.- qnameis calculated from- name.
- toStr
- virtual override Str toStr()- Returns a string representation the referenced value. 
- val
- Obj? val- The object held in - Actor.locals. If a value is not mapped when read,- initFunc()is called to create a default object.