ServicePool class

Manages a collection of Service instances.

Each service is started when added via addService. Message delivery is event-driven: each Service registers a native callback with the C++ side (set_message_callback) and drains its own queue when the C++ worker notifies it. No periodic timer is involved.

Basic usage

final pool = ServicePool();

final colorService = ColorService('libcolor.so');
colorService.assignJob((msg) { /* ... */ });

pool.addService(colorService);
// No startPolling() needed — messages are delivered on demand.

Call dispose when the pool is no longer needed to stop all services.

Constructors

ServicePool()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addService(Service newService) bool
Adds newService to the pool and calls its start_service function.
dispose() → void
Stops all registered services and releases their native callbacks.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited