How to handle several container scenarios?
See original GitHub issueIs your feature request related to a problem? Please describe. I have a use case where I need to be able to manage multiple containers each with specific settings. By settings I mean a different object to inject to the last nested object.
Description To do so It would be very great if we could instantiate containers this way:
let container1 = new Container();
let container2 = new Container();
And then āattachā the settings object (in my use case) to containers like this:
container1.register("SettingsClass", {
provider: () => settingsObject1
});
container2.register("SettingsClass", {
provider: () => settingsObject2
});
So when resolving objects the right settingsObject1 will be injected and successfully get
const myService1 = container1.resolve(MyService);
const myService2 = container2.resolve(MyService);
Maybe there is already a way to do it but I could not find it, could you help me? PS: Iām a noob in typescript š
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Understanding Container Scenarios and Overview of Docker
The main purpose of application containers is to package different component of the application in separate container. The different componentĀ ...
Read more >Run multiple services in a container | Docker Documentation
Run multiple services in a container. A container's main running process is the ENTRYPOINT and/or CMD at the end of the Dockerfile ....
Read more >Containers: one single process, or multiple processes?
If you need to run multiple processes, it's generally recommended to place each process in its own container. You can run multiple containers...
Read more >Kubernetes multi-container pods and container communication
Some examples include log or data change watchers, monitoring adapters, and so on. A log watcher, for example, can be built once by...
Read more >Container Tidbits: When Should I Break My Application into ...
In reality, many applications use multiple processes per container. The Apache Web Server prefork and MPM modules both use multiple processesĀ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Xapphire13 Iām in the process of updating the documentation - what exactly needs to be documented here? That you can have multiple containers, or that you can have containers with fallback using
createChildContainer()
?Edit: I see - we have no documentation on containers at all.
Ok thank you, itās perfect š