Scala extensions for the Kryo serialization library.
Chill provides a a number of Kryo serializers and an Option-like type called the MeatLocker. The MeatLocker allows you to box Kryo-serializable objects and deserialize them lazily on the first call to get
:
val boxedCodec = new MeatLocker(new LongCodec)
// boxedCodec is java.io.Serializable no matter what it contains.
val codec = roundTripThroughJava(boxedCodec)
val encoded = codec.get.encode(1L)
val decoded = codec.get.decode(encoded)
decoded == 1L // true
To retrieve the boxed item without caching the deserialized value, use meatlockerInstance.copy
.
Chill provides support for singletons, scala Objects and the following types:
- Scala primitives
- scala.Symbol
- scala.reflect.Manifest
- scala.reflect.ClassManifest
- Collections and sequences
- scala.collection.immutable.Map
- scala.collection.immutable.List
- scala.collection.immutable.Vector
- scala.collection.immutable.Set
- scala.collection.mutable.WrappedArray
- all 22 scala tuples
Current version is 0.0.4
. groupid="com.twitter"
artifact="chill_2.9.2"
.
- Oscar Boykin https://twitter.com/posco
- Mike Gagnon https://twitter.com/MichaelNGagnon
- Sam Ritchie https://twitter.com/sritchie
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0