Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Document dev mode not running eager bindings on start #10469

@hoxu

Description

@hoxu

Scala Dependency Injection / Eager bindings:

If you want to create them once and also create them eagerly when the application starts up, rather than lazily when they are needed, then you can Guice’s eager singleton binding.
...
Eager singletons can be used to start up a service when an application starts.

However, there is no mention that dev mode does not create eager bindings until the first request. It's mentioned in a 2016 thread here:

https://groups.google.com/g/play-framework/c/21G3eEU-3Y8

I think the eager bindings chapter would be a good spot to mention this.

Play Version

2.8.2

API

Scala

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions