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

Update FsPickler version used by Akka.FSharp #1207

Merged
merged 1 commit into from
Aug 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/core/Akka.FSharp/Akka.FSharp.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<None Include="packages.config" />
<None Include="Akka.FSharp.nuspec" />
<None Include="README.md" />
<Content Include="app.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="FSharp.PowerPack">
Expand All @@ -91,7 +92,8 @@
<HintPath>..\..\packages\FSPowerPack.Linq.Community.3.0.0.0\Lib\Net40\FSharp.PowerPack.Linq.dll</HintPath>
</Reference>
<Reference Include="FsPickler">
<HintPath>..\..\packages\FsPickler.0.9.11\lib\net45\FsPickler.dll</HintPath>
<HintPath>..\..\packages\FsPickler.1.2.21\lib\net45\FsPickler.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="System" />
Expand All @@ -104,6 +106,8 @@
<Reference Include="FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
10 changes: 5 additions & 5 deletions src/core/Akka.FSharp/FsApi.fs
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ module Serialization =

let internal serializeToBinary (fsp:BinarySerializer) o =
use stream = new System.IO.MemoryStream()
fsp.Serialize(o.GetType(), stream, o)
fsp.Serialize(stream, o)
stream.ToArray()

let internal deserializeFromBinary (fsp:BinarySerializer) (bytes: byte array) (t: Type) =
let internal deserializeFromBinary<'t> (fsp:BinarySerializer) (bytes: byte array) =
use stream = new System.IO.MemoryStream(bytes)
fsp.Deserialize(t, stream)
fsp.Deserialize<'t> stream

// used for top level serialization
type ExprSerializer(system) =
Expand All @@ -358,7 +358,7 @@ module Serialization =
override __.Identifier = 9
override __.IncludeManifest = true
override __.ToBinary(o) = serializeToBinary fsp o
override __.FromBinary(bytes, t) = deserializeFromBinary fsp bytes t
override __.FromBinary(bytes, _) = deserializeFromBinary fsp bytes


let internal exprSerializationSupport (system: ActorSystem) =
Expand Down Expand Up @@ -390,7 +390,7 @@ type ExprDeciderSurrogate(serializedExpr: byte array) =
interface ISurrogate with
member this.FromSurrogate _ =
let fsp = Nessos.FsPickler.FsPickler.CreateBinary()
let expr = (Serialization.deserializeFromBinary fsp (this.SerializedExpr) typeof<Expr<(exn->Directive)>>) :?> Expr<(exn->Directive)>
let expr = (Serialization.deserializeFromBinary<Expr<(exn->Directive)>> fsp (this.SerializedExpr))
ExprDecider(expr) :> ISurrogated

and ExprDecider (expr: Expr<(exn->Directive)>) =
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.FSharp/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FsPickler" version="0.9.11" targetFramework="net45" />
<package id="FsPickler" version="1.2.21" targetFramework="net45" />
<package id="FSPowerPack.Core.Community" version="3.0.0.0" targetFramework="net45" />
<package id="FSPowerPack.Linq.Community" version="3.0.0.0" targetFramework="net45" />
</packages>