You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.
CAVEAT - The Ref unpickler should probably actually just be a direct runtime call, rather than what happens now.
Proposal
// Note: The RefRegistry should actually be a TLS, and handle a specific pickle/unpickle call.traitRefRegistry {
// PicklingdefregisterPicklee(picklee: Any):Int// UnpicklingdefpreregisterUnpicklee():IntdefregsiterUnpicklee(oid: Int, value: Any):UnitdeflookupUnpicklee(oid: Int):Option[Any]
// Removes all instances from the registry. This should be done AFTER a top-level unpickle/pickle call.defclear():Unit
}
// User-Facing API (for making picklers)// Each of these methods NEEDS to be 100% thread-safe.traitPicklerRegistry {
deflookupUnpickler[T]:Unpickler[T]
deflookupPickler[T]:Pickler[T]
defregisterPickler[T](p: Pickler[T]):UnitdefregisterUnpickler[T](p: Unpickler[T]):Unit// TODO - Some kind of clean or inspect what we have?
}
traitPicklingRuntime {
//// Ideally these do not show up at all.defcurrentMirror:MirrordefGRL:GRL.type//// User-Facing API (for making picklers)// Each of these methods NEEDS to be 100% thread-safe.defmakeFastTag[T](tagKey: String):FastTypeTag[T]
defpicklers:PicklerRegistry//// User-Facing API for `Ref` and circular reference handlingdefreferences:RefRegistry//// Provider API?// TODO - A mechanism to replace the runtime-pickler-generator
}
objectPicklingRuntime {
defcurrent:PicklingRuntime= ...
// Note: This would need to have a way to ensure registered picklers can be obtained from the previous, in the// event we do static initialization...defreplace(next: PicklingRuntime):PicklingRuntime= ...
}