1 | | | import '../channel.dart'; |
2 | | |
|
3 | | | /// Annotation for service methods to be exposed by workers. |
4 | | | class SquadronMethod { |
5 | | 11 | const SquadronMethod( |
6 | | | {this.inspectRequest = false, this.inspectResponse = false}); |
7 | | |
|
8 | | | /// Indicates whether the contents of the incoming message should be inspected |
9 | | | /// by Squadron before sending the request to the worker. By default, incoming |
10 | | | /// messages are not inspected except for the startup message. The purpose of |
11 | | | /// message inspection is to detect non-base-type data that require transfer of |
12 | | | /// ownership to the target worker. E.g. if the request data include a [Channel] |
13 | | | /// object, [inspectRequest] must be set to `true`. |
14 | | | final bool inspectRequest; |
15 | | |
|
16 | | | /// Same as [inspectRequest] but for outgoing messages (response produced by the |
17 | | | /// worker). |
18 | | | final bool inspectResponse; |
19 | | | } |
20 | | |
|
21 | | | const squadronMethod = SquadronMethod(); |