Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify custom pickler cache with Thespian? #184

Open
mjmckp opened this issue May 29, 2018 · 1 comment
Open

How to specify custom pickler cache with Thespian? #184

mjmckp opened this issue May 29, 2018 · 1 comment

Comments

@mjmckp
Copy link

mjmckp commented May 29, 2018

I am attempting to specify a custom pickler with Thespian, using the following setup code:

        let registry = CustomPicklerRegistry()

        registry.RegisterFactory <| fun (resolver : IPicklerResolver) ->
            let writer (w: WriteState) (x: MyType) =
                // code...
    
            let reader (r: ReadState) : MyType =
                // code...
    
            Pickler.FromPrimitives(reader, writer)

        registry.DeclareSerializable<MyType>()

        let cache = PicklerCache.FromCustomPicklerRegistry registry

        Nessos.Thespian.Serialization.defaultSerializer <- new FsPicklerMessageSerializer(FsPickler.CreateBinarySerializer(picklerResolver = cache))

However, when I attempt to run a cloud calculation, I get MBrace.FsPickler.NonSerializableTypeException for MyType. It seems like Thespian is always using the default instance of MBrace.FsPickler.PicklerCache instead of the cache created above...

@mjmckp
Copy link
Author

mjmckp commented May 29, 2018

@eiriktsarpalis Any hints appreciated, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant