Hi everyone
We used mutiny to develop our backend services. We cached some data with the Quarkus @CacheResult annotation. While this works ok for Uni's, since Caffein also uses Uni's under the hood.
How is caching done for Multi's?
It would be great to have a more clear explanation how to cache Uni's AND Multi's in the Quarkus caching guide.
If in the @CacheResult annotated method I subscribe to a multi and collect it and then return a Uni<List<MyType>> it tells me, I am blocking the thread.
@CacheResult(cacheName = BITBUCKET_REPO_BRANCHES)
public Uni<List<GitBranchDto>> getBranchesForRepo(String projectKey, String repositorySlug) {
return Uni.createFrom().item(
bitbucketClient.getBranchesForRepo(projectKey, repositorySlug, PageRequest.fetchAll())
.subscribe()
.asStream()
.collect(Collectors.toList()))
;
}
In general I miss also a guide for caching in the Mutiny Guide.
Thanks for your help
Manu