ISolutionCacheService Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Solution cache interface to upload or retrieve cache entries and manage cache containers.
public interface class ISolutionCacheService
public interface ISolutionCacheService
type ISolutionCacheService = interface
Public Interface ISolutionCacheService
Remarks
This interface is designed to work with a content addressable storage and directory structures from Bazel API that is documented at Bazel API.
The intended usage is as follows: For writes, consumer first adds entries via AddItemAsync(PipeReader, CacheStorageTypes, CancellationToken) and then creates a container that contains the item keys linked to item names they generate.
For reads, consumer first retrieves the CacheContainer instance and then looks up the CacheItemKey using the Items dictionary amd fetches the item contents using TryGetItemAsync(CacheItemKey, PipeWriter, CancellationToken) using the key stored in Items dictionary.
This model ensures that key calculation is transparent to consumers and can also encode additional data about keys that is required by Bazel API.
Methods
AddContainerAsync(CacheContainer, CancellationToken) |
Adds a cache item container to the cache with the specified key. |
AddItemAsync(PipeReader, CacheStorageTypes, CancellationToken) |
Tries to add an item to cache and return a unique key. Stream will be read till end to determine content and size. |
PrefetchContainerAsync(CacheContainerKey, CancellationToken) |
Ensures that container contents are prefetched to local cache. |
TryGetContainerAsync(CacheContainerKey, CancellationToken) |
Tries to get the list of items in a cache container entry. |
TryGetItemAsync(CacheItemKey, PipeWriter, CancellationToken) |
Tries to retrieve an item from cache that is assigned to a particular key. |