fixes #4 adds backend and server logic to new classes #5
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 not sure this is quite ready to merge, as I haven't fixed the documentation yet nor tested with real haproxy instances, but in the following days this should be ready to merge. Have a look as this is a major change. All unit tests are passing at this point. I'll be playing around with this new code in a real environment this week but you can review this for now. Its pretty functional and allows one to play around with server or backend objects instead of the instance. The objects are scoped so you only see backend or server related information gathered from the stats.
I also moved the socket to its own file in case the user wants to create a server or backend object without using the instance object.
These new objects will create a bunch more chatter on the socket channel so I was thinking of going back and adding some sort of cache layer to HAPSocket to reduce the number of calls to the socket. Not sure what would happen to haproxy if the socket is over utilized.
To use you essentially do the following: