LCOV - code coverage report

Current view
top level - src/_impl/native - _local_worker.dart
Test
lcov.info
Date
2024-11-13
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines151693.8%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'dart:async';
2import 'dart:isolate';
3
4import '../../channel.dart';
5import '../../exceptions/exception_manager.dart';
6import '../../local_worker/local_worker.dart';
7import '../../worker_service.dart';
8import '../xplat/_worker_runner.dart';
9import '_worker_runner.dart';
10
11base class _VmLocalWorker<W extends WorkerService> extends LocalWorker<W> {
121 _VmLocalWorker._(super.service, ExceptionManager exceptionManager) {
131 final runner = WorkerRunner.use(this);
143 _port.listen(runner.handle);
152 _channel = Channel.deserialize(
163 _port.sendPort, runner.internalLogger, exceptionManager)!;
17 }
18
19 final _port = ReceivePort();
20 late Channel? _channel;
21
221 @override
231 Channel? get channel => _channel;
24
251 @override
26 ExceptionManager get exceptionManager =>
272 (_exceptionManager ??= ExceptionManager());
28 ExceptionManager? _exceptionManager;
29
301 @override
31 void stop() {
322 _port.close();
332 _channel?.close();
341 _channel = null;
35 }
36
370 @override
38 FutureOr<void> start() {}
39}
40
41/// Creates a [LocalWorker] on a native platform.
421LocalWorker<W> createLocalWorker<W extends WorkerService>(
43 W service, ExceptionManager exceptionManager) =>
441 _VmLocalWorker._(service, exceptionManager);
Choose Features