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

Refactor Hub to drop the Place class #42

Merged
merged 4 commits into from
Feb 2, 2024
Merged

Refactor Hub to drop the Place class #42

merged 4 commits into from
Feb 2, 2024

Conversation

holesch
Copy link
Owner

@holesch holesch commented Feb 2, 2024

  • util: Add on_error() context manager
  • test_hub: Fixup compatible type
  • test_hub: Use jsonrpc for agent
  • Hub: Refactor to drop the Place class

`compatible` is a list according to the model.
When using contextvars, then all methods must be called in the same
context as agent_communicate(). Instead of implementing a complete fake
serve_forever() method, that executes the methods received through some
sort of queue, just reuse jsonrpc with a fake connection.
Move all the logic from the Place classmethods to the Hub singleton.
After that, there's no reason to keep the Place class at all.

Introduce contextvars for the reservation context and client IP address.
Now the _ReservationContext class is unnecessary.
@holesch holesch merged commit ca5e0c4 into master Feb 2, 2024
4 checks passed
@holesch holesch deleted the refactor-hub branch February 2, 2024 00:59
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.

1 participant