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

Added Context Manager to Server Class #213

Merged
merged 1 commit into from
Aug 3, 2024
Merged

Conversation

RudreshVeerkhare
Copy link
Contributor

This project is really awesome tried this and solved the exact problem I was facing; I'm wondering if you'd be happy with adding context manager support to Server class.
Like currently in documentation, it's given as :

from gcp_storage_emulator.server import create_server

server = create_server("localhost", 9023, in_memory=False)

server.start()
# ........
server.stop()

But after adding context manager support, it'd look like :

from gcp_storage_emulator.server import Server

with Server("localhost", 9023, in_memory=False) as server:
     # .........
     # ........

As this might look like a small change, but this would be really convenient.
Also thanks for such a nice project 😁

Copy link
Contributor

@JacobHayes JacobHayes left a comment

Choose a reason for hiding this comment

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

Agreed!

Copy link
Owner

@oittaa oittaa left a comment

Choose a reason for hiding this comment

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

lgtm

@oittaa oittaa merged commit b7ec8dc into oittaa:main Aug 3, 2024
10 checks passed
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.

3 participants