org.infinispan.hotrod.MutinyToAsyncCacheEntryProcessor Maven / Gradle / Ivy
The newest version!
package org.infinispan.hotrod;
import io.smallrye.mutiny.Multi;
import org.infinispan.api.async.AsyncCacheEntryProcessor;
import org.infinispan.api.common.MutableCacheEntry;
import org.infinispan.api.common.process.CacheEntryProcessorContext;
import org.infinispan.api.common.process.CacheEntryProcessorResult;
import org.infinispan.api.mutiny.MutinyCacheEntryProcessor;
import java.util.concurrent.Flow;
public class MutinyToAsyncCacheEntryProcessor implements AsyncCacheEntryProcessor {
private final MutinyCacheEntryProcessor mutinyCacheEntryProcessor;
public MutinyToAsyncCacheEntryProcessor(MutinyCacheEntryProcessor mutinyCacheEntryProcessor) {
this.mutinyCacheEntryProcessor = mutinyCacheEntryProcessor;
}
@Override
public Flow.Publisher> process(Flow.Publisher> entries, CacheEntryProcessorContext context) {
return mutinyCacheEntryProcessor.process(Multi.createFrom().publisher(entries), context).convert().toPublisher();
}
}