Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Make ProtosRegistry a class instead of singleton #165

Open
zenyui opened this issue Sep 2, 2020 · 1 comment
Open

Make ProtosRegistry a class instead of singleton #165

zenyui opened this issue Sep 2, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@zenyui
Copy link
Contributor

zenyui commented Sep 2, 2020

Is your feature request related to a problem? Please describe.
ProtoRegistry is a little hard to test/deal with as a singleton. We tried making it a class, but the ApiSerializer fails with the error:

Can't generate a Lagom client for io.superflat.lagompb.data.TestService since the following abstract methods don't return service calls or topics: protosRegistry

Describe the solution you'd like
somehow convert ProtoRegistry to a class with a companion to instantiate with reflection (easier to test, mock, pass around), but in a way that does not require doing a new reflection of proto classes for each serialized response.

Describe alternatives you've considered
leaving it as it is...

Additional context
n/a

@Tochemey
Copy link
Contributor

Tochemey commented Sep 5, 2020

This will only be possible when lagom service definition allow such way of injecting field via DI.

@Tochemey Tochemey added the enhancement New feature or request label Nov 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants