LCOV - code coverage report

Current view
top level - src/_impl/native - _local_worker.dart
Test
lcov.info
Date
2025-03-26
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines91656.2%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'dart:async';
2import 'dart:isolate';
3
4import 'package:logger/web.dart';
5import 'package:using/using.dart';
6
7import '../../channel.dart';
8import '../../exceptions/exception_manager.dart';
9import '../../exceptions/task_terminated_exception.dart';
10import '../../local_worker/local_worker.dart';
11import '../../typedefs.dart';
12import '../xplat/_worker_runner.dart';
13import '_worker_runner.dart';
14
15base class _VmLocalWorker<W> with Releasable implements LocalWorker<W> {
161 _VmLocalWorker._(this.service, this.operations, this.exceptionManager) {
171 final runner = WorkerRunner.use(this);
183 _port.listen(runner.handle);
192 _channel = Channel.deserialize(
204 _port.sendPort, runner.internalLogger, exceptionManager)!;
21 }
22
23 @override
24 final W service;
25
26 @override
27 final OperationsMap operations;
28
29 @override
30 final ExceptionManager exceptionManager;
31
32 @override
33 Logger? channelLogger;
34
35 final _port = ReceivePort();
36 late Channel? _channel;
37
381 @override
391 Channel? get channel => _channel;
40
410 @override
42 FutureOr<void> start() {}
43
440 @override
45 void stop() {
460 _port.close();
470 _channel?.close();
480 _channel = null;
49 }
50
510 @override
520 void terminate([TaskTerminatedException? ex]) => stop();
53}
54
55/// Creates a [LocalWorker] on a native platform.
561LocalWorker<W> createLocalWorker<W>(W service, OperationsMap operations,
57 ExceptionManager exceptionManager) =>
581 _VmLocalWorker<W>._(service, operations, exceptionManager);
Choose Features