nfroidure / nfroidure/knifecycle
Consider changing some internal services to singletons
@nfroidure is already working on this.
Since Aug 16, 2023.
- Dominant language
- TypeScript
- Stars
- 34
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Some services, like $fatalError should probably be singletons since they concern the processes (its only use is atm here:
https://github.com/nfroidure/common-services/blob/main/src/process.ts#L84-L88
Some other ain't that simple to determine INJECTOR and SILO_CONTEXT are not singletons and it looks difficult to change their nature:
https://github.com/nfroidure/knifecycle/blob/86a34ca367a13cbfa62def2a98bca0a5d0fdd180/src/index.ts#L397-L398
Maybe that the autoloader itself should not be a singleton and be tied to its silo context? That said since initializers are the same for all silos, the autoloader would be a singleton that finally load the same things for each silos? Weird... Or not?
Have to think about it more, let's not include it into the v16.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.