bindFreeWrapper<A, S> method

void bindFreeWrapper<A, S>(
  1. String id,
  2. Type isolateWorkerType
)

Implementation

void bindFreeWrapper<A, S>(String id, Type isolateWorkerType) {
  assert(
    _freeWrappers.containsKey(isolateWorkerType) && (_freeWrappers[isolateWorkerType]?.isNotEmpty ?? false),
    'No free worker wrapper for $isolateWorkerType',
  );

  _wrappers[id] = _freeWrappers[isolateWorkerType]!.removeAt(0)
    ..connectToWorker(id);
}