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.
I am trying something new with spec changes. Please let me know your thoughts (to the ghosts of the machine most likely) on this format for spec changes. Note, I am thinking of doing this kind of spec write up/documentation for Spec Changes only (as it is quite intensive).
Below is the spec this PR is aiming to implement
Provider host connection management proposal
Related Issues:
Abstraction
To better accommodate more complex providers (such as SSH, distant, rsync, etc), we should consider creating a
way to both indicate to the provider that a connection event has been requested as well as indicate that a disconnection
event has been requested. Additionally, a provider should be given a way to inform the API if a URI Host is currently
connected or not. Lastly, moving in line with #117 , all connection and disconnection processing should have an optional (recommended though) asynchronous counterpart.
Implementation
API
The facilitate communication to abstracted providers from consumers, it would make sense to have all connection/disconnection
events be processed via the exposed Netman API. This means the following functions would need to be created within the API
Additionally, 2 new netman events need to be created
Below is the proposed signatures for the above functions
connect_to_uri_host
disconnect_from_uri_host
has_connection_to_uri_host
Provider
In order for the API to leverage these connection events, a provider will need to
implement the following functions.
In order to support asynchronous events, an additional (recommended)
_a
variant of theconnect_host
andclose_host
functions can be implementedNOTE: These functions are optional, though if they are not implemented, the
API will not be able to leverage connection events and information for any protocols
that the provider supports.
Below is the proposed signatures for the above functions
connect_host
connect_host_a
is_connected
close_host
close_host_a