Skip to content

chore: Re-design streaming services.#5276

Open
prmukherj wants to merge 11 commits into
mainfrom
maint/redesign_events_manager
Open

chore: Re-design streaming services.#5276
prmukherj wants to merge 11 commits into
mainfrom
maint/redesign_events_manager

Conversation

@prmukherj

@prmukherj prmukherj commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Context

In previous PRs all the grpc services were properly segregated so that the low level grpc code remains in _grpc_services and the high level python layer in services. Now the streaming services also requires similar redesign. Moreover, there were instances of server_supports_v1 leaking in the python codebase.

Change Summary

  1. Streaming services redesigned in a similar manner so that the grpc related code remains in the _grpc_services and the high level python code in streaming_services
  2. There are no more leaking instances of server_supports_v1 in the PyFluent codebase.
  3. The proto version handling, etc. have all been taken care of in the low level factory.
  4. The PyFluent session code is much cleaner now with no unnecessary imports and having the services directly available via 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:

  1. Datamodel Event Streaming
  2. Datamodel Streaming
  3. Events Streaming
  4. Field Data Streaming
  5. Monitor Streaming
  6. Transcript Streaming

@github-actions github-actions Bot added the enhancement Improve any current implemented feature label Jul 21, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@seanpearsonuk

Copy link
Copy Markdown
Collaborator

@prmukherj Please make the description detailed so that reviewers know where to look and for what.

@prmukherj

Copy link
Copy Markdown
Collaborator Author

@prmukherj Please make the description detailed so that reviewers know where to look and for what.

On it.

@prmukherj prmukherj changed the title chore: Re-design EventsManager. chore: Re-design streaming services. Jul 21, 2026
@prmukherj
prmukherj marked this pull request as ready for review July 21, 2026 12:30
@seanpearsonuk

seanpearsonuk commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

General comments

  1. GRPCServiceFactory and ServiceFactory both use internal conditionals where separate factories would make more sense. Use abstract factory pattern with some methods raising NotImplementedError in derived classes.
  2. GRPCServiceFactory stores unused attributes.
  3. error_state is plumbed all the way through into services where separate interceptors are eventually created - multiple times. intercept_channel should be created once in the factory and passed to each service. Error state is an unwanted service dependency.
  4. Proto version attribute is too weakly typed.

@seanpearsonuk seanpearsonuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Initial comments from read through of _grpc_services.__init__.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There's an inaccurate docstring regarding raw stubs:

class ServiceFactory:
    """Wraps raw gRPC stubs from ``GRPCServiceFactory`` in version-appropriate high-level service objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improve any current implemented feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants