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

Perform "closing" call for session in get() #31

Open
CasperWA opened this issue Mar 15, 2022 · 1 comment
Open

Perform "closing" call for session in get() #31

CasperWA opened this issue Mar 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@CasperWA
Copy link
Contributor

Just as a session is created in the pipelines' get() method, it should be "closed" as well.

This is especially beneficial if there are any external or other objects that should only live as long as the pipeline should live.
The main issue here being that the session itself is continuously serialized between the server's Python instance and the redis cache, and hence local (or other) objects related to the lifetime of a pipeline cannot be trusted to attach to the lifetime of a Python session object.

@CasperWA CasperWA added the enhancement New feature or request label Mar 15, 2022
@CasperWA
Copy link
Contributor Author

I don't think this makes sense (anymore - or even then). The session is created and "closed" in the time it takes to run the pipeline's get() method.

The only thing I can see is to have a call back to the service to say "the pipelines has finished, you can clear the redis cache of this session object now". And if the same pipeline's get() method is then called again, the whole thing starts over - OR one could cache the get() method's return value in this repository for some time? An lru_cache or something? Or maybe not.

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

No branches or pull requests

1 participant