Introduce startClientFactories
method to Servient
#187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As it is the case with the
Servient
class innode-wot
, thestart
method indart_wot
is currently marked asasync
. This makes sense in general, as the start methods of the servers registered with theServient
are also asynchronous.However, as the corresponding
init
method of theProtocolClientFactories
is not asynchronous (at least indart_wot
), it would be possible to start the Servient synchronously and not require the surrounding environment to beasync
as well. Having such a synchronous, partialstart
method can therefore be beneficial for applications that only act as consumers.To address this use case, this PR introduces a synchronous
startClientFactories
method that basically does what it advertises. It also applies some minor refactoring of the server starting code.As, as far as I can tell, the
ProtocolClientFactory
s innode-wot
do not actually perform any actions at the moment in theirinit
methods, maybe this is also something that considered fornode-wot
as well.