LCOV - code coverage report

Current view
top level - /src - _sequence_id.dart
Test
lcov.info
Date
2022-04-02
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines33100.0%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1/// Singleton class used to generate unique IDs for cancellation tokens.
2///
3/// The class implements a simple counter that is incremented each time a new ID will be requested. Because of Dart's
4/// architecture, this guarantees unicity per event loop (thread) only. If the [SequenceId] is used from an Isolate
5/// or a Web Worker, IDs may overlap across threads. This may be a problem in complex scenarios where workers invoke
6/// other workers while creating their own cancellation tokens. Ideally, workers should forward the cancellation token
7/// they received when calling other workers.
8class SequenceId {
92 SequenceId._();
10
114 static final instance = SequenceId._();
12
13 int _id = 0;
14
153 int next() => ++_id;
16}
Choose Features