Commit Graph

6 Commits

Author SHA1 Message Date
Naz
37dd187fe6
Added adapter caching based on features
refs https://github.com/TryGhost/Toolbox/issues/384

- Adapter cache was not able to store multiple object instances derived from same Base class. This created a need to create boilerplate "shell" classes inheriting from the Base class, e.g.: ImageSizeCacheSyncInMemory etc.
- Having feature-based adapter instance caching in the adapter manager allows to simplify configuration and reuse the "base class" instead of creating artificial "shell" classes.
- For example with this change both image sizes and settings caches will create separate cache instances deriving from default "Memory" class. Less code, less configuration!
2022-09-06 17:51:57 +08:00
Naz
0f86a05ed4
Added ":" syntax to adapter manager
refs https://github.com/TryGhost/Toolbox/issues/384

- The syntax using a colon ":" separator has been successfully used to enable multiple adapters. The adapter manager can benefit from same convention to enable more elastic adapter cache - have multiple instances of adapters from same base class
2022-09-06 17:51:57 +08:00
Naz
2f2033e7c5
Improved adapter manager JSDoc
refs https://github.com/TryGhost/Toolbox/issues/384

- The config is an optional parameter as not all class constructors necessarily have have to have configuration values
2022-09-06 17:51:57 +08:00
Fabien O'Carroll
f618bc5fcd Improved error messages for loading adapters
no-issue

Adds back functionality from
3988029472
2020-04-07 16:33:39 +02:00
Fabien O'Carroll
db96ccbfe5 Added check for Adapter prototype name
no-issue

This fixes issues when the adapter is using a different "instance" of
the base class, so we check the names are the same.
2020-04-07 15:29:15 +02:00
Fabien O'Carroll
44db45b7c3 Added @tryghost/adapter-manager module (#38)
no-issue
2020-04-05 15:54:47 +02:00