Service for managing mechanisms using both a distributed cache and remote HTTP service.
This service provides methods to fetch, create, and delete mechanisms. It interacts with a distributed cache for efficient data retrieval and synchronises with a remote service via HTTP for data persistence and updates.
Type parameters
F
The effect type (e.g., IO, SyncIO, etc.) that supports concurrency.
Value parameters
baseUri
The base URI of the remote mechanism service.
cacheService
The distributed cache service used for storing and retrieving mechanisms.
client
The HTTP client for making requests to the remote mechanism service.
This method sends a POST request to the remote mechanism service to create a new mechanism. The created mechanism is then added to the distributed cache.
Value parameters
mechanism
The mechanism to create.
Attributes
Returns
An effectful computation that yields the created Mechanism upon success.
This method first checks the distributed cache for the requested mechanism. If the mechanism is not found in the cache, it fetches the data from the remote mechanism service and updates the cache.
Value parameters
id
The unique identifier of the mechanism to fetch.
Attributes
Returns
An effectful computation that yields the MechanismDetails for the given ID.