Skip to content

Commit

Permalink
feat(servient): add optional clientFactories contructor parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Dec 19, 2023
1 parent 3be4625 commit 6099cbb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/core/servient.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ class Servient {
/// A custom [contentSerdes] can be passed that supports other media types
/// than the default ones.
Servient({
List<ProtocolClientFactory>? clientFactories,
ServerSecurityCallback? serverSecurityCallback,
ContentSerdes? contentSerdes,
}) : contentSerdes = contentSerdes ?? ContentSerdes(),
_serverSecurityCallback = serverSecurityCallback;
_serverSecurityCallback = serverSecurityCallback {
for (final clientFactory in clientFactories ?? <ProtocolClientFactory>[]) {
addClientFactory(clientFactory);
}
}

final List<ProtocolServer> _servers = [];
final Map<String, ProtocolClientFactory> _clientFactories = {};
Expand Down

0 comments on commit 6099cbb

Please sign in to comment.