Thread-safe component registry with pooling support
Instance methods
cleanup_all
Thread-safe component cleanup on close
Sourcecleanup_disconnected(gc_interval :
Time::Span) :
Nil Thread-safe iteration with cleanup
Sourcedelete(id :
String) :
Component |
Nil Thread-safe component removal
Sourceget(id :
String) :
Component |
Nil Thread-safe component retrieval
Sourceget_from_pool(type :
String, & : ->
Component) :
Component Get component from pool or create new one
Sourceget_typed(id :
String, type :
T.class) :
T |
Nil forall
T Type-safe component retrieval with compile-time type checking
Returns nil if component doesn't exist or is not of the expected type
Example:
if counter = registry.get_typed("counter_1", CounterComponent)
counter.increment # No cast needed, type is CounterComponent
end
Sourceregister(id :
String, component :
Component) :
Nil Thread-safe component registration
Sourcesize
Get current component count (for monitoring)
Source