LCOV - code coverage report

Current view
top level - src/local_worker - local_worker_client.dart
Test
lcov.info
Date
2025-03-26
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines51050.0%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'dart:async';
2
3import 'package:cancelation_token/cancelation_token.dart';
4import 'package:using/using.dart';
5
6import '../channel.dart';
7import '../invoker.dart';
8import '../tokens/_squadron_cancelation_token.dart';
9import '../typedefs.dart';
10import '../worker/worker_request.dart';
11import '../worker_service.dart';
12import 'local_worker.dart';
13
14/// Base class used to communicate with a [LocalWorker].
15///
16/// Typically, derived classes should add proxy methods sending [WorkerRequest]s to the worker.
17class LocalWorkerClient with Releasable implements WorkerService, Invoker {
18 /// Create a client for a [LocalWorker]. The [channel] passed to this client must have been obtained by
19 /// calling [Channel.share] on the [LocalWorker.channel].
201 LocalWorkerClient(this.channel);
21
22 /// The [Channel] to communicate with the [LocalWorker].
23 final Channel channel;
24
250 @override
26 void release() {
270 channel.close();
280 super.release();
29 }
30
31 /// Sends a command to the [LocalWorker].
321 @override
33 Future<dynamic> send(int command,
34 {List args = const [],
35 CancelationToken? token,
36 bool inspectRequest = false,
37 bool inspectResponse = false}) =>
382 channel.sendRequest(command, args,
390 token: token?.wrap(),
40 inspectRequest: inspectRequest,
41 inspectResponse: inspectResponse);
42
43 /// Sends a streaming command to the [LocalWorker].
441 @override
45 Stream<dynamic> stream(int command,
46 {List args = const [],
47 CancelationToken? token,
48 bool inspectRequest = false,
49 bool inspectResponse = false}) =>
502 channel.sendStreamingRequest(command, args,
510 token: token?.wrap(),
52 inspectRequest: inspectRequest,
53 inspectResponse: inspectResponse);
54
55 /// Local worker clients do not need an [operations] map.
56 @override
57 final OperationsMap operations = WorkerService.noOperations;
58}
Choose Features