Update creating projector instance - #40
Open
mvdwetering wants to merge 8 commits into
Open
mvdwetering wants to merge 8 commits into
mvdwetering wants to merge 8 commits into
Conversation
Collaborator
Author
|
@pszafer I have been making some updates recently that were all backward compatible, so I felt comfortable merging them. This however is a breaking change. I would like your input on this. |
Owner
|
Hi, nice changes! |
and use future annotations for nicer typehint syntax
mvdwetering
force-pushed
the
update_creating_projector_instance
branch
from
June 20, 2026 14:34
f101080 to
3ba966d
Compare
mvdwetering
force-pushed
the
update_creating_projector_instance
branch
from
June 20, 2026 14:49
3ba966d to
fde38d9
Compare
This is new because of the .wait_closed() call.
Collaborator
Author
|
Not sure why it was a staticmethod, probably because in C++ those would be Changed it to a classmethod. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The construction of the Projector class got more complicated with adding the password support. For HTTP it needed to be setup manually in the websession outside of Projector, for TCP there was a
tcp_passwordoption. So there were different sets of parameters needed for each type.I reworked the construction of the Projector class so now it takes a
connection. Each connection only takes the parameters it needs so it is clear what is needed for which one.I added helper factorymethods to keep things simple for users of the package. They just call the helper and get a Projector.
Examples of typical calls
I ended up moving the websession into ProjectorHttp() see 757753e. Setting it up in the helper seemed a bit clumsy and in general having to setup the websession manually outside for the password seems weird. This package should make it easy to connect to a projector and manually managing the authentication on the websession is not easy.
However it does mean that for ProjectorHttp now also
projector.close()needs to be called to close the now internal websession. Which makes it more consistent that close is needed for all.There is also a small change to
close()as it has become async to allow awaiting the closing of the session and also needed to properly await closes on the other protocols