refactor: Re-design streaming services. - #5276
Conversation
Up to standards ✅🟢 Issues
|
|
@prmukherj Please make the description detailed so that reviewers know where to look and for what. |
On it. |
General comments
|
seanpearsonuk
left a comment
There was a problem hiding this comment.
Initial comments from read through of _grpc_services.__init__.
…sys/pyfluent into maint/redesign_events_manager
@seanpearsonuk, I have implemented all your suggestions except 3. Why I had initially avoided it is because some services like batch ops and solution variables does not require the full stack of error interceptors, whereas some like events and transcript does not require any interceptors and initialize with just the raw channel. There are 2 options here to do this without tampering with the design much, one is if we pass these contexts from factory, which is again not a good idea. Other is if we somehow have these contexts in the service classes as class variables and can be queried and based on that we pass the required type of channel to it. The easiest option was to pass the intercept channel with the full set of interceptors defined for every service but I wanted your feedback before doing that as it will affect performance. Even if a service does not use the ErrorStateInterceptor, TracingInterceptor, or BatchInterceptor, gRPC will still force every single remote procedure call (RPC) through those interceptors. Please provide your views on this one. Thanks |
|
Nightly test runs: https://github.com/ansys/pyfluent/actions/runs/29889780984 |
My proposal doesn't imply the situation you describe. It also solves more than one design issue. |
Something like this is suggested right? |
Avoid agglomerating the various service dependencies. Construct each service by passing what the service needs which is also what it should request. Both of these points are also general rules. |
## Context This tidy's up the grpc services code by fixing docstrings and deleting unwanted imports, etc. ## Change Summary 1. Some unwanted imports were deleted. 2. Some files were put in their updated locations (just to improve readability throughout the repo). 3. Docstrings were properly set and cleaned up. ## Impact No user facing updates. Method docstings improve in documentations. --------- Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>


Context
In previous PRs all the grpc services were properly segregated so that the low level grpc code remains in
_grpc_servicesand the high level python layer inservices. Now the streaming services also requires similar redesign. Moreover, there were instances ofserver_supports_v1leaking in the python codebase.Change Summary
_grpc_servicesand the high level python code instreaming_servicesserver_supports_v1in the PyFluent codebase.fluent_connection.service_factory.Rationale
This was done to provide a clean segregation to the PyFluent users, so that in future other services can be plugged in with minimal effort.
Impact
No impact to users.
All tests running fine.
Services covered in this refactoring: