Skip to content

Enhance the behavior of Gateway connection managers #82

@JeremyWurbs

Description

@JeremyWurbs

Description

Currently, the auto-generated Gateway connection managers have some magic to add registered app endpoints as connection manager attributes when the service is registered with an accompanying connection manager.

I.e.

from mindtrace.services import Gateway
from mindtrace.services.sample.echo_service import EchoService

echo = EchoService.launch(url="http://localhost:8080/")
gateway = Gateway.launch(url="http://locahost:8081/")

gateway.register_app("echoer", "http://localhost:8080/", echo)

# Now the `gateway` connection manager will have magically inherited the `echo` endpoints as attributes
gateway.echoer.echo(message="Hello, world!")

This magic only works for the Gateway connection manager that registered the service, however. The following will not work:

# Starting from the above, connect a new Gateway connection manager
gateway2 = Gateway.connect(url="http://localhost:8081/")
gateway2.echoer.echo(message="Goodbye, world :(")  # Does not work

This task is to correct this issue, such that connecting to a Gateway service will always provide the same endpoint-as-attribute magic.

Acceptance Criteria

  • Working example, clearly demonstrating the behavior
  • 100% test coverage, with additional integration tests testing actual usage and corner cases

Priority

Low (cleanup or optional enhancement)

Estimated Effort (Story Points)

2 (1 day)

Metadata

Metadata

Assignees

Labels

mindtrace-servicesIssues raised from services module in mindtrace package

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions