simerplaha / SwayDB

Persistent and in-memory key-value storage engine for JVM that scales on a single machine.
https://swaydb.simer.au
Apache License 2.0
293 stars 16 forks source link

Remove `IO.Defer` #355

Open simerplaha opened 2 years ago

simerplaha commented 2 years ago

Overview

Currently IO.Defer instance is created to execute each request to support all effect types/libraries such as Try, Future, ZIO, Cats-effect, Glass etc.

Issue

IO.Defer is a heap allocation that should be removed.

Task

Replace class IO.Defer which an explicit object BagExecutor that is injected at compile time which provides the implementation on how the request should be executed based on the type of the Bag that can be either Asynchronous/Non-blocking or Synchronous/Blocking