These are chat archives for akkadotnet/akka.net

8th
Feb 2018
David Rivera
@mithril52
Feb 08 2018 00:19
Has anyone seen any issues with running Akka.NET on different versions of .NET? Ex, 4.6.1, 4.6.2 and 4.7.1 I'm seeing some odd behavior where an issue happens when running on a server with 4.6.2, the executable built with 4.6.2. But I don't see the issue when the executable it built with 4.7.1, running on a server with 4.6.2. The issue is that DistributedPubSub communication between the nodes seems to break down. It works fine within each node separately, but if a messages needs to go from one node to another, it doesn't seem to get there.
Onur Gumus
@OnurGumus
Feb 08 2018 05:11
I think the default Newtonsoft Serializer is slightly inefficient. It should have used StreamReader and StreamWriter instead of
JsonConvert.DeserializeObject(Encoding.UTF8.GetString(bytes), this.Settings), this, type);
which causes double conversion.
Bartosz Sypytkowski
@Horusiath
Feb 08 2018 07:23
@OnurGumus in general we're going to redesign the serialization API, when Akka.NET will be upgraded to .NET 2.0 (which will happen probably around v1.5)
Onur Gumus
@OnurGumus
Feb 08 2018 07:24
okay.
Bartosz Sypytkowski
@Horusiath
Feb 08 2018 07:24
current one requires serializer to return byte array, we were thinking about Stream for some time, but this is also not the best solution
Onur Gumus
@OnurGumus
Feb 08 2018 07:24
Still with byte array above solution is slow
Bartosz Sypytkowski
@Horusiath
Feb 08 2018 07:25
.NET Standard 2.0 comes with a lot of low level, low-allocation data structures: spans, memory pools, byte segments etc.
Onur Gumus
@OnurGumus
Feb 08 2018 07:25
 public override object FromBinary(byte[] bytes, Type type)
        {
            using (var streamReader = new StreamReader(new MemoryStream(bytes), Encoding.UTF8))
            {
                return ser.Deserialize(streamReader, type);
            }
        }
this is what I would do for deserialization
And
        public override byte[] ToBinary(object obj)
        {
            var memoryStream = new MemoryStream();
            using (var streamWriter = new StreamWriter(memoryStream, Encoding.UTF8))
            {
                ser.Serialize(streamWriter, obj);
            }
            return memoryStream.ToArray();
        }
Bartosz Sypytkowski
@Horusiath
Feb 08 2018 07:25
I thinks it's good idea for contribution ;)
Onur Gumus
@OnurGumus
Feb 08 2018 07:25
yes I will do
Bartosz Sypytkowski
@Horusiath
Feb 08 2018 07:26
thanks :)
Arjen Smits
@Danthar
Feb 08 2018 12:04
@Horusiath @OnurGumus Didn't we have a resourcepool for MemoryStreams ?
Onur Gumus
@OnurGumus
Feb 08 2018 13:28
Yes that's even much better
Onur Gumus
@OnurGumus
Feb 08 2018 14:31
Can I someway use derived interfaces of iactorref?
Like Orleans
chipdice
@chipdice
Feb 08 2018 15:36
Whats the minimum .Net framwork for running the latest Akka?
Onur Gumus
@OnurGumus
Feb 08 2018 15:38
@chipdice , .net framework. 4.5 or .net standard 1.6
chipdice
@chipdice
Feb 08 2018 15:38
Thanks
Lutando Ngqakaza
@Lutando
Feb 08 2018 16:11
Receive<A<B>>(Handle)
wont match to a message A<C> where C is derived from B?
Onur Gumus
@OnurGumus
Feb 08 2018 17:08
@Lutando google c# covariance out
A has to be an interface with "out" B
voltcode
@voltcode
Feb 08 2018 20:13
What's the best way to pass large objects 10-100MB between actors, in-memory?
Assuming readonly access for actors further down the processing pipeline
I want to read a file in an actor pass most of it around in a local actor system
voltcode
@voltcode
Feb 08 2018 20:40
or maybe I forgot something and messages are not serialized and deserialized when passing messages within local actor system?
someone here https://stackoverflow.com/questions/41963882/passing-larger-akka-messages-within-the-same-jvm says messages in jvm akka are not serialized locally, is this the case for .NET ?
Bartosz Sypytkowski
@Horusiath
Feb 08 2018 20:50
@voltcode same in .net
voltcode
@voltcode
Feb 08 2018 20:51
ah, that's awesome
thanks