Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of a view layer #844

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Flonja
Copy link
Contributor

@Flonja Flonja commented Jan 23, 2024

Co-authored-by: RestartFU

Co-authored-by: RestartFU <45609733+restartfu@users.noreply.github.com>
@@ -232,6 +235,7 @@ func (s *Session) Close() error {
// close closes the session, which in turn closes the controllable and the connection that the session
// manages.
func (s *Session) close() {
_ = s.viewLayer.Close()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should one viewer leaving close the entire view layer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because they left?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if multiple sessions has the same view layer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 session = 1 view layer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then why do view layers store multiple sessions at the moment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every player has it's own layer, so that each player can be different, only to a certain player

}

// Close closes the view layer.
func (v *ViewLayer) Close() error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also remove the view layer instance from the viewers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like v = nil?
Can you be clearer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete(viewer.viewers, v.e) or something I think, e being the owner of the view layer

@Flonja
Copy link
Contributor Author

Flonja commented May 26, 2024

I feel like I should revise the naming for this... (ViewLayer, Layer and LayerViewer)
It gets confusing quickly and I doubt the user using this api would understand too.
Suggestions are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants