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

Strongly type the Lagom service router #888

Merged
merged 1 commit into from Jul 20, 2017

Conversation

jroper
Copy link
Member

@jroper jroper commented Jul 18, 2017

If you want to use a custom router that delegates to the Lagom router, or in my case, if you're writing a Play app but you want to embed a Lagom service implementation into it, then in order to take advantage of type based dependency injection, you need to be able to refer to the Lagom service router by type. This introduces a type for the Lagom service router in both the Java and Scala APIs, so that they can be injected by type into another Play router.

/**
* A Lagom service router.
*
* This trait doesn't add anything, except that it makes the router created by the LagomServer
Copy link
Member

Choose a reason for hiding this comment

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

Maybe better to use the term "interface" instead of "trait" here as the target audience are java developers

@jroper jroper force-pushed the typed-service-router branch 2 times, most recently from 64a76d8 to ab31e15 Compare July 19, 2017 07:09
If you want to use a custom router that delegates to the Lagom router,
or in my case, if you're writing a Play app but you want to embed a
Lagom service implementation into it, then in order to take advantage of
type based dependency injection, you need to be able to refer to the
Lagom service router by type. This introduces a type for the Lagom
service router in both the Java and Scala APIs, so that they can be
injected by type into another Play router.
@TimMoore
Copy link
Contributor

@jroper do you want this in 1.3.7?

@octonato octonato merged commit e068e56 into lagom:master Jul 20, 2017
octonato pushed a commit to octonato/lagom that referenced this pull request Jul 20, 2017
If you want to use a custom router that delegates to the Lagom router,
or in my case, if you're writing a Play app but you want to embed a
Lagom service implementation into it, then in order to take advantage of
type based dependency injection, you need to be able to refer to the
Lagom service router by type. This introduces a type for the Lagom
service router in both the Java and Scala APIs, so that they can be
injected by type into another Play router.
@octonato
Copy link
Member

Backported in 1.3.x (a6bedc7)

@TimMoore TimMoore added this to the 1.3.7 milestone Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants