This is something that Omer Zach brought up in the Gitter channel, and we'd need to do some modifications to Fetch in order to support it. The idea is that, if you have an IO[A] or IO[Option[A]] that represents a Fetch but can't be batched, you should be able to lift it to Fetch. These IO actions wouldn't be batched or cached, so they execute every time a Fetch is run regardless of the contents of the cache.
def getUser: IO[User] = ???
def maybeGetUser: IO[Option[User]] = ???
def fetchUser[F[_] : ConcurrentEffect] : Fetch[F, User] = Fetch.liftIO(getUser)
def maybeFetchUser[F[_] : ConcurrentEffect] : Fetch[F, Option[User]] = Fetch.liftIO(maybeGetUser)
As a "side-effect", we'd be able to embed arbitrary IO actions in a Fetch, even those that perform writes/logging/debugging or anything else.
This is something that Omer Zach brought up in the Gitter channel, and we'd need to do some modifications to Fetch in order to support it. The idea is that, if you have an
IO[A]orIO[Option[A]]that represents a Fetch but can't be batched, you should be able to lift it to Fetch. These IO actions wouldn't be batched or cached, so they execute every time a Fetch is run regardless of the contents of the cache.As a "side-effect", we'd be able to embed arbitrary IO actions in a Fetch, even those that perform writes/logging/debugging or anything else.