done method
Done ends the span and releases associated resources.
Implementation
@override
void done() {
if (_isDone) {
_logWarn('BUG: done() called on already done scope $name');
return;
}
final currentStat = stat;
// Release this scope's resources from every ancestor, each once, then
// drop the references held on the direct parents (the owner of a span,
// or the edges).
for (final scope in _ancestors) {
scope._releaseResourcesForChild(currentStat);
}
for (final parent in _parents) {
parent.decRef();
}
// Clear local resources
_resources.memory = 0;
_resources.streamsInbound = 0;
_resources.streamsOutbound = 0;
_resources.connsInbound = 0;
_resources.connsOutbound = 0;
_resources.fds = 0;
_isDone = true;
// TODO: trace.DestroyScope(name);
// log.debug('Scope done: $name');
}