graphql-java / java-dataloader

A Java 8 port of Facebook DataLoader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I store the cache to a remote server

lyzq opened this issue · comments

commented

I want to store the cache to a remote server, and i implement CacheMap.
Then i got :
Serialized class java.util.concurrent.CompletableFuture must implement java.io.Serializable

Yup there is a design fault in the current code, that is what looks like CacheMap<U, V> is in fact CacheMap<U, CompletableFuture<V>>

And CompletableFuture is never going to be able to be serialised.

This has caught other people out. Our cache is in fact previously completed CFs -> values and not the values themselves.

This needs a major refactpr to fix

This PR attempts to improve this situation

#88