Created
March 1, 2025 05:29
-
-
Save ghostdogpr/12623d0c711eb59adfda044d2c63f38f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.esotericsoftware.kryo.io.{Input, Output} | |
import com.twitter.chill.{KSerializer, Kryo} | |
import scala.runtime.LazyVals | |
import scala.runtime.LazyVals.LazyValControlState | |
class LazyValControlStateSerializer extends KSerializer[LazyValControlState] { | |
override def read(kryo: Kryo, input: Input, cls: Class[LazyValControlState]): LazyValControlState = { | |
kryo.readClassAndObject(input).asInstanceOf[LazyValControlState] | |
} | |
override def write(kryo: Kryo, output: Output, obj: LazyValControlState): Unit = | |
kryo.writeClassAndObject(output, null) | |
} | |
val ser = new LazyValControlStateSerializer | |
// code omitted | |
k.register(classOf[LazyVals.Waiting], ser) | |
k.register(classOf[LazyVals.Evaluating.type], ser) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment