LCOV - code coverage report

Current view
top level - src/_impl/native - _channel_forward.dart
Test
lcov.info
Date
2025-03-26
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines61154.5%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1part of '_channel.dart';
2
3/// [Channel] used to communicate between [Isolates]s. Creates a
4/// [vm.ReceivePort] to receive commands and forwards them to the worker's [vm.SendPort].
5final class _VmForwardChannel extends _VmChannel {
6 /// [_remote] is the worker's [web.MessagePort], [_com] is the intermediate
7 /// message channel
83 _VmForwardChannel._(this._remote, this._com, Logger? logger,
9 ExceptionManager exceptionManager)
106 : super._(_com.sendPort, logger, exceptionManager) {
119 _com.listen(_forward);
12 }
13
14 /// [web.MessagePort] to the worker.
15 final vm.SendPort _remote;
16
17 /// [web.MessageChannel] used for forwarding messages.
18 final vm.ReceivePort _com;
19
20 /// Forwards [data] to the worker.
213 void _forward(dynamic data) {
223 if (_closed) {
230 throw SquadronErrorImpl.create('Channel is closed');
24 }
256 _remote.send(data);
26 }
27
28 /// Closes this [Channel], effectively stopping message forwarding.
290 @override
30 void close() {
310 if (!_closed) {
320 _com.close();
330 _closed = true;
34 }
35 }
36}
Choose Features