| Hit | Total | Coverage | |
|---|---|---|---|
| Lines | 1 | 2 | 50.0% |
| Functions | 0 | 0 | - |
| Branches | 0 | 0 | - |
| Line | Branch | Hits | Source code |
|---|---|---|---|
| 1 | import 'package:meta/meta.dart'; |
||
| 2 | |
||
| 3 | import '_platform.dart'; |
||
| 4 | |
||
| 5 | /// Singleton class used to generate unique IDs for cancelation tokens. |
||
| 6 | /// |
||
| 7 | /// The class implements a simple counter that is incremented each time a new |
||
| 8 | /// ID is requested. Workers should forward the cancelation token they received |
||
| 9 | /// when calling other workers. |
||
| 10 | @internal |
||
| 11 | class TokenId { |
||
| 12 | 0 | TokenId._(); |
|
| 13 | |
||
| 14 | static int _id = 0; |
||
| 15 | |
||
| 16 | /// Provides the next ID. |
||
| 17 | 8 | static String next() => '${++_id}@$threadId'; |
|
| 18 | } |